-
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
feat: support LargeList
in array_dims
#8592
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,16 @@ AS VALUES | |
(make_array(make_array(15, 16),make_array(NULL, 18)), make_array(16.6, 17.7, 18.8), NULL) | ||
; | ||
|
||
statement ok | ||
CREATE TABLE large_arrays | ||
AS | ||
SELECT | ||
arrow_cast(column1, 'LargeList(List(Int64))') AS column1, | ||
arrow_cast(column2, 'LargeList(Float64)') AS column2, | ||
arrow_cast(column3, 'LargeList(Utf8)') AS column3 | ||
FROM arrays | ||
; | ||
|
||
statement ok | ||
CREATE TABLE slices | ||
AS VALUES | ||
|
@@ -2820,8 +2830,7 @@ NULL 10 | |
## array_dims (aliases: `list_dims`) | ||
|
||
# array dims error | ||
# TODO this is a separate bug | ||
query error Internal error: could not cast value to arrow_array::array::list_array::GenericListArray<i32>\. | ||
query error Execution error: array_dims does not support type 'Int64' | ||
select array_dims(1); | ||
|
||
# array_dims scalar function | ||
|
@@ -2830,6 +2839,11 @@ select array_dims(make_array(1, 2, 3)), array_dims(make_array([1, 2], [3, 4])), | |
---- | ||
[3] [2, 2] [1, 1, 1, 2, 1] | ||
|
||
query ??? | ||
select array_dims(arrow_cast(make_array(1, 2, 3), 'LargeList(Int64)')), array_dims(arrow_cast(make_array([1, 2], [3, 4]), 'LargeList(List(Int64))')), array_dims(arrow_cast(make_array([[[[1], [2]]]]), 'LargeList(List(List(List(List(Int64)))))')); | ||
---- | ||
[3] [2, 2] [1, 1, 1, 2, 1] | ||
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. 👍 |
||
|
||
# array_dims scalar function #2 | ||
query ?? | ||
select array_dims(array_repeat(array_repeat(array_repeat(2, 3), 2), 1)), array_dims(array_repeat(array_repeat(array_repeat(3, 4), 5), 2)); | ||
|
@@ -2842,12 +2856,22 @@ select array_dims(make_array()), array_dims(make_array(make_array())) | |
---- | ||
NULL [1, 0] | ||
|
||
query ?? | ||
select array_dims(arrow_cast(make_array(), 'LargeList(Null)')), array_dims(arrow_cast(make_array(make_array()), 'LargeList(List(Null))')) | ||
---- | ||
NULL [1, 0] | ||
|
||
# list_dims scalar function #4 (function alias `array_dims`) | ||
query ??? | ||
select list_dims(make_array(1, 2, 3)), list_dims(make_array([1, 2], [3, 4])), list_dims(make_array([[[[1], [2]]]])); | ||
---- | ||
[3] [2, 2] [1, 1, 1, 2, 1] | ||
|
||
query ??? | ||
select list_dims(arrow_cast(make_array(1, 2, 3), 'LargeList(Int64)')), list_dims(arrow_cast(make_array([1, 2], [3, 4]), 'LargeList(List(Int64))')), list_dims(arrow_cast(make_array([[[[1], [2]]]]), 'LargeList(List(List(List(List(Int64)))))')); | ||
---- | ||
[3] [2, 2] [1, 1, 1, 2, 1] | ||
|
||
# array_dims with columns | ||
query ??? | ||
select array_dims(column1), array_dims(column2), array_dims(column3) from arrays; | ||
|
@@ -2860,6 +2884,18 @@ NULL [3] [4] | |
[2, 2] NULL [1] | ||
[2, 2] [3] NULL | ||
|
||
query ??? | ||
select array_dims(column1), array_dims(column2), array_dims(column3) from large_arrays; | ||
---- | ||
[2, 2] [3] [5] | ||
[2, 2] [3] [5] | ||
[2, 2] [3] [5] | ||
[2, 2] [3] [3] | ||
NULL [3] [4] | ||
[2, 2] NULL [1] | ||
[2, 2] [3] NULL | ||
|
||
|
||
## array_ndims (aliases: `list_ndims`) | ||
|
||
# array_ndims scalar function #1 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
please check args not empty, especially if its pub function
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 will address this later in the pull request as other functions may also lack this check.