-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 array literal with scalar function #8884
Merged
jackwener
merged 3 commits into
apache:main
from
jayzhan211:fix-array-literal-with-struct
Jan 18, 2024
Merged
Changes from all commits
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 |
---|---|---|
|
@@ -456,11 +456,33 @@ AS | |
FROM nested_arrays_with_repeating_elements | ||
; | ||
|
||
# Array literal | ||
|
||
## boolean coercion is not supported | ||
query error | ||
select [1, true, null] | ||
|
||
query error DataFusion error: This feature is not implemented: ScalarFunctions without MakeArray are not supported: now() | ||
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. Can we add more to covert |
||
SELECT [now()] | ||
## wrapped in array_length to get deterministic results | ||
query I | ||
SELECT array_length([now()]) | ||
---- | ||
1 | ||
|
||
## array literal with functions | ||
query ? | ||
select [abs(-1.2), sin(-1), log(2), ceil(3.141)] | ||
---- | ||
[1.2, -0.8414709848078965, 0.3010299801826477, 4.0] | ||
|
||
## array literal with nested types | ||
query ??? | ||
select | ||
[struct('foo', 1)], | ||
[struct('foo', [1,2,3])], | ||
[struct('foo', [struct(3, 'x')])] | ||
; | ||
---- | ||
[{c0: foo, c1: 1}] [{c0: foo, c1: [1, 2, 3]}] [{c0: foo, c1: [{c0: 3, c1: x}]}] | ||
|
||
query TTT | ||
select arrow_typeof(column1), arrow_typeof(column2), arrow_typeof(column3) from arrays; | ||
|
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.
I love it -- less code and more functionality ❤️ !