Skip to content

Conversation

@andygrove
Copy link
Member

No description provided.

@andygrove andygrove changed the title ARROW-6668: [Rust] [DataFusion[ Implement CAST expression ARROW-6668: [Rust] [DataFusion] Implement CAST expression Sep 23, 2019
@andygrove andygrove self-assigned this Sep 23, 2019
Copy link
Contributor

@paddyhoran paddyhoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @andygrove

let result = result
.as_any()
.downcast_ref::<UInt32Array>()
.expect("failed to downcast to UInt32Array");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about how the API is designed to work here. Why don't you handle the downcast in evaluate based on data_type()? Is it just that you don't want the user to always incur the cost of the match on data_type().


impl PhysicalExpr for CastExpr {
fn name(&self) -> String {
"CAST".to_string()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: there is inconsistency in upper vs lower case for name. The literal one was lower case, this one and SUM were upper case.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants