Skip to content

Conversation

@dmitriibugakov
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
@dmitriibugakov dmitriibugakov force-pushed the update-ascii-utf8view-11834 branch from c94858c to 3dddecc Compare August 8, 2024 11:16
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

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