Skip to content

expr.get_type (ExprSchemable::get_type) returns wrong type for array functions on nested lists #13755

Description

@findepi

Describe the bug

When list is nested, containing a non-List list-like type, then this assertion doesn't hold true

let udf = array_element_udf();
let udf_type = udf.inner().return_type(&[list_type, index_type])?;

let simplified = Expr::ScalarFunction(expr::ScalarFunction {
        func: udf,
        args: args,
    });

let expr_type = SimplifyInfo::get_data_type(&info, &simplified)?;

assert_eq!(udf_type, expr_type);
assertion `left == right` failed
  left: List(Field { name: "element", data_type: Binary, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} })
 right: FixedSizeList(Field { name: "element", data_type: Binary, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, 1)

To Reproduce

No response

Expected behavior

For a scalar function call, the SimplifyInfo::get_data_type and ExprSchemable::get_type should return the same type the scalar would return.

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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