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
ARROW-9977: [Rust] Added min/max of [Large]StringArray #8215
Conversation
Rebased. |
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 the logic is correct. I have a test and a style suggestion, but I think this could be merged as is.
return None | ||
} | ||
let mut n = ""; | ||
let mut has_value = false; |
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 you could also use an option here rather than a flag + value.
So something like let mut n = None;
And then instead of
has_value = true;
n = item;
something like
n = Some(item);
} | ||
} | ||
} | ||
Some(n) |
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.
then you could return n directly
This was merged as part of #8172 and will thus be closed. I also marked the respective Jira issue as done. |
Note that, contrarily to horizontal operations, that we can represent as
f(&ArrayRef) -> ArrayRef
, in vertical operations likemin
andsum
, we do not have a dynamically-typed struct to return, and thus need to have a function signature for each type. :(I wonder if we could have in Rust a dynamically struct for single values, like DataFusion has ScalarValue.