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
Implement constant folding for CAST #513
Conversation
data_type, | ||
} => match inner.as_ref() { | ||
Expr::Literal(val) => { | ||
let scalar_array = val.to_array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea👍 I think converting to an array is the best we can do for now, without duplicating the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is looking superb! Thanks @msathis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @msathis !
.build() | ||
.unwrap(); | ||
|
||
let expected = "Projection: Int32(0)\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is beautiful ❤️ -- thank you @msathis
.build() | ||
.unwrap(); | ||
|
||
let expected = "Projection: Int32(NULL)\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Which issue does this PR close?
Closes #417.
Rationale for this change
Optimize cast function during planning stage
What changes are included in this PR?
Optimize cast function during planning stage
Are there any user-facing changes?
N/A