Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
findepi opened this issue Dec 13, 2024 · 0 comments · Fixed by #13756
Closed
Labels
bug Something isn't working

Comments

@findepi
Copy link
Member

findepi commented Dec 13, 2024

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
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant