Skip to content

change the input_type parameter of the create_udaf function from DataType to Vec<DataType>  #7094

@jiangzhx

Description

@jiangzhx

Describe the bug

For someone who is new to DataFusion and is trying to write a custom UDAF, it may be a little confusing to understand why create_udaf only takes one DataType for the input_type. Additionally, I did not find any examples demonstrating how to create a UDAF with multiple input arguments.

https://github.com/apache/arrow-datafusion/blob/52cf58b46133d448e067455baab0faf8a50e565a/datafusion/expr/src/expr_fn.rs#L802-L809

To Reproduce

No response

Expected behavior

change input_type: DataType to input_type: Vec<DataType>

pub fn create_udaf(
    name: &str,
    
    return_type: Arc<DataType>,
    volatility: Volatility,
    accumulator: AccumulatorFactoryFunction,
    state_type: Arc<Vec<DataType>>,
) -> AggregateUDF {

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions