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 LargeList for arrow_cast, support ScalarValue::LargeList #8290

Merged
merged 8 commits into from
Nov 22, 2023

Conversation

Weijun-H
Copy link
Member

@Weijun-H Weijun-H commented Nov 21, 2023

Which issue does this PR close?

Closes #.

Rationale for this change

It is hard to test LargeList in sqllogictest #8121, the convenient idea is to use arrow_cast() instead of make_array

What changes are included in this PR?

  • support LargeList for arrow_cast
  • support ScalarValue::LargeList
  • support ScalarValue::new_large_list
  • support LargeList for protobuf

Are these changes tested?

Are there any user-facing changes?

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.

Thank you @Weijun-H -- this looks very nice 👍

@alamb alamb changed the title support LargeList for arrow_cast support LargeList for arrow_cast, support ScalarValue::LargeList Nov 21, 2023
@@ -342,7 +346,38 @@ impl PartialOrd for ScalarValue {
None
}
}
(LargeList(arr1), LargeList(arr2)) => {
if arr1.data_type() == arr2.data_type() {
Copy link
Contributor

Choose a reason for hiding this comment

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

@Weijun-H can you try (in a follow on PR) to use the arrow lt kernels diectly on the list (rather than calling it on each element)? I can't remember if the kernel knows how to handle things

if list_arr1.len() != list_arr2.len() {
return None;
}
for i in 0..list_arr1.len() {
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 the list lengths should always be 1, so I don't really understand why this is iterating (though I see it is just following the pattern of ListArray)

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you can clean it up in a follow on PR (by asserting the list is length 1)

Copy link
Member Author

@Weijun-H Weijun-H Nov 22, 2023

Choose a reason for hiding this comment

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

I will work on this on the next PR

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 think @jayzhan211 is working on this #8253

@alamb alamb merged commit f2b0344 into apache:main Nov 22, 2023
22 checks passed
@alamb
Copy link
Contributor

alamb commented Nov 22, 2023

Thanks again @Weijun-H

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sql SQL Planner sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants