Skip to content

default impl for WindowUDFImpl::expressions should use all input expressions #13168

@Michael-J-Ward

Description

@Michael-J-Ward

Is your feature request related to a problem or challenge?

#12857 added the expressions method to the WindowUDFImpl trait.

The default impl currently only takes the first input_expr and discards the rest.

fn expressions(&self, expr_args: ExpressionArgs) -> Vec<Arc<dyn PhysicalExpr>> {
expr_args
.input_exprs()
.first()
.map_or(vec![], |expr| vec![Arc::clone(expr)])
}

This altered behavior caused a regression in a two column Window UDF used in datafusion-python tests. See this comment detailing the error and this commit that fixes it.

Describe the solution you'd like

The default behavior should just return all the input expressions.

Describe alternatives you've considered

I didn't find any justification for only taking the first input_expr as the default behavior, so probably I'm missing something.

@jcsherin - please let me know if there's a reason that I'm missing for this behavior.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions