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

Remove type coercion of case expression in Expr::Schema #5821

Closed
alamb opened this issue Apr 1, 2023 · 1 comment · Fixed by #6614
Closed

Remove type coercion of case expression in Expr::Schema #5821

alamb opened this issue Apr 1, 2023 · 1 comment · Fixed by #6614
Assignees
Labels
bug Something isn't working

Comments

@alamb
Copy link
Contributor

alamb commented Apr 1, 2023

As part of fixing #5733 in #5734 we installed a workaround that manipulates the calculation of the type of a Case expression

A better solution would be to fix the expression initially (by coercing the types correctly), but that was blocked on #5733

Once #5733 is complete, we should remove the workaround put in Expr::schema

Details below:

          The type coercion is implemented as an optimizer - and it changes schemas of particular `Expr`essions.

And it takes care of Expr::Case.

But Expr::Projection caches the schema in itself - so it is not updated! Therefore we get a mismatch between declared schema vs batch schema.

Essentially this PR makes Expr::Case to not change a schema during the coercion optimizer.

Originally posted by @mslapek in #5734 (comment)

@alamb alamb added the bug Something isn't working label Apr 1, 2023
@alamb alamb changed the title The type coercion is implemented as an optimizer - and it changes schemas of particular Expressions. Remove type coercion of case expression in Expr::Schema Apr 1, 2023
@jackwener
Copy link
Member

I'm working on it

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.

2 participants