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

support from_slice for binary, string, and boolean array types #1589

Merged
merged 2 commits into from
Jan 17, 2022

Conversation

jimexist
Copy link
Member

@jimexist jimexist commented Jan 17, 2022

Which issue does this PR close?

Closes #.

Rationale for this change

the motivation is to ease the transition of APIs onto arrow2

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the datafusion Changes in the datafusion crate label Jan 17, 2022
@jimexist
Copy link
Member Author

@houqp after this is merged i guess you can rebase arrow2 branch onto master and reduce some amount of diffs

I: AsRef<[u8]>,
{
fn from_slice(slice: S) -> Self {
let slice = slice.as_ref();
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this could call from_iter_values rather than replicate the code in DataFuson?

I haven't tried but perhaps something like

fn from _slice(slice: S) -> Self {
  GenericBinaryArray::from_iter_values(slice.iter())

?

https://docs.rs/arrow/7.0.0/arrow/array/struct.GenericStringArray.html#method.from_iter_values

Copy link
Member Author

@jimexist jimexist Jan 17, 2022

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

i guess this change is necessary:

datafusion/src/from_slice.rs Show resolved Hide resolved
@alamb alamb merged commit 30df911 into master Jan 17, 2022
@alamb alamb deleted the from-slice branch January 17, 2022 14:43
@alamb alamb mentioned this pull request Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants