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

ARROW-9977: [Rust] Added min/max of [Large]StringArray #8215

Closed
wants to merge 1 commit into from
Closed

ARROW-9977: [Rust] Added min/max of [Large]StringArray #8215

wants to merge 1 commit into from

Conversation

jorgecarleitao
Copy link
Member

Note that, contrarily to horizontal operations, that we can represent as f(&ArrayRef) -> ArrayRef, in vertical operations like min and sum, 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.

@github-actions
Copy link

@jorgecarleitao
Copy link
Member Author

Rebased.

Copy link
Contributor

@alamb alamb left a 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;
Copy link
Contributor

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)
Copy link
Contributor

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

@jorgecarleitao
Copy link
Member Author

This was merged as part of #8172 and will thus be closed. I also marked the respective Jira issue as done.

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.

None yet

3 participants