-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add support for FixedSizeList type in arrow_cast
, hashing
#8344
Changes from 5 commits
068e736
27e1b10
6d9687a
5a6ab22
78e7d2f
b6ce1d2
7eb3d73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -384,4 +384,35 @@ LargeList(Field { name: "item", data_type: Int64, nullable: true, dict_id: 0, di | |
query T | ||
select arrow_typeof(arrow_cast(make_array([1, 2, 3]), 'LargeList(LargeList(Int64))')); | ||
---- | ||
LargeList(Field { name: "item", data_type: LargeList(Field { name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }) | ||
LargeList(Field { name: "item", data_type: LargeList(Field { name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }) | ||
|
||
## FixedSizeList | ||
|
||
query ? | ||
select arrow_cast(null, 'FixedSizeList(1, Int64)'); | ||
---- | ||
NULL | ||
|
||
#TODO: arrow-rs doesn't support it yet | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we be casting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed that the List supports casting from UTF8 to List with a single size. Therefore, I think FixedSizeList should also support it.
|
||
#query ? | ||
#select arrow_cast('1', 'FixedSizeList(1, Int64)'); | ||
#---- | ||
#[1] | ||
|
||
query error DataFusion error: Optimizer rule 'simplify_expressions' failed | ||
select arrow_cast(make_array(1, 2, 3), 'FixedSizeList(4, Int64)'); | ||
|
||
query ? | ||
select arrow_cast(make_array(1, 2, 3), 'FixedSizeList(3, Int64)'); | ||
---- | ||
[1, 2, 3] | ||
|
||
query T | ||
select arrow_typeof(arrow_cast(arrow_cast(make_array(1, 2, 3), 'LargeList(Int64)'), 'FixedSizeList(3, Int64)')); | ||
---- | ||
FixedSizeList(Field { name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, 3) | ||
|
||
query ? | ||
select arrow_cast([1, 2, 3], 'FixedSizeList(3, Int64)'); | ||
---- | ||
[1, 2, 3] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see any test coverage for this new code -- e.g. either unit tests for hashing or a higher level test like
GROUP BY <FixedListArray>
Can you either ensure this code is tested somehow, or else perhaps move the hash support to a different PR so we can merge the
arrow_cast
support ?