-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Feature][Transform] Sql transform support array and split function #8016
[Feature][Transform] Sql transform support array and split function #8016
Conversation
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.
LGTM if ci passes. Thanks @CosmosNi !
…-selectItem-support-array
@@ -70,11 +68,13 @@ public static Object nullif(List<Object> args) { | |||
return v1; | |||
} | |||
|
|||
public static Object array(List<Object> args) { | |||
public static String[] array(List<Object> args) { |
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.
Why does it return a fixed string[]?
Example:
Array(1, 2, 3) returns Integer[]
Array(1L, 2, 3) returns Long[]
Array(1L, 1.1F, 2.1D) returns Double[]
Array(true, false, true) returns Boolean[]
Array(true, "aaa", 1) returns String[]
Array(1, true, 3L) returns String[]
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.
Of course, you can merge this pr and submit a new PR to optimize this 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.
case ZetaSQLFunction.ARRAY:
return ArrayType.STRING_ARRAY_TYPE;
Then we need to dynamically generate the returned ArrayType.
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.
Then we need to dynamically generate the returned ArrayType.
+1, we can reuse
seatunnel/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/type/TypeUtil.java
Line 23 in d2576ff
public static boolean canConvert(SeaTunnelDataType<?> from, SeaTunnelDataType<?> to) { |
…pache#8016) Co-authored-by: njh_cmss <[email protected]>
selectItem support array and split func
Purpose of this pull request
Does this PR introduce any user-facing change?
How was this patch tested?
Check list
New License Guide
release-note
.