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

Update ASCII scalar function to support Utf8View #11834 #11884

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

dmitrybugakov
Copy link
Contributor

Which issue does this PR close?

Closes #11834.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Aug 8, 2024
let string_array = args[0].as_string_view();
calculate_ascii(string_array.iter())
}
_ => unreachable!(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we return internal_err!("Unsupported data type") instead of panic here?


fn calculate_ascii<'a, I>(string_array: I) -> Result<ArrayRef>
where
I: IntoIterator<Item = Option<&'a str>>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
I: IntoIterator<Item = Option<&'a str>>,
I: ArrayAccessor<Item = &'a str>,

As exampled in https://github.com/apache/arrow-rs/blob/e28cf44e65cdd1fefaa1b857ca4336e7a9da5d06/arrow-array/src/array/mod.rs#L487-L507

@dmitrybugakov dmitrybugakov force-pushed the update-ascii-utf8view-11834 branch 2 times, most recently from e380fa1 to dad81cf Compare August 8, 2024 14:03
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.

Looks great to me -- thank you @dmitrybugakov and @XiangpengHao for the revieww

@alamb alamb merged commit 0ce6d16 into apache:main Aug 8, 2024
24 checks passed
@dmitrybugakov dmitrybugakov deleted the update-ascii-utf8view-11834 branch August 8, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the ASCII scalar function to support Utf8View
3 participants