You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "hanyuzheng7 (via GitHub)" <gi...@apache.org> on 2023/06/27 00:45:13 UTC

[GitHub] [flink] hanyuzheng7 commented on a diff in pull request #22785: [FLINK-32259]-table-Add-ARRAY_JOIN-function

hanyuzheng7 commented on code in PR #22785:
URL: https://github.com/apache/flink/pull/22785#discussion_r1242996736


##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/BaseExpressions.java:
##########
@@ -1408,6 +1409,24 @@ public OutType arrayUnion(InType array) {
                 unresolvedCall(ARRAY_UNION, toExpr(), objectToExpression(array)));
     }
 
+    /**
+     * Returns a string that represents the concatenation of the elements in the given array and the
+     * elements' data type in the given array is string. The `delimiter` is a string that separates
+     * each pair of consecutive elements of the array. The optional `nullReplacement` is a string
+     * that replaces null elements in the array.
+     *
+     * <p>Returns null if input array or delimiter or nullReplacement are null.
+     */
+    public OutType arrayJoin(InType delimiter, InType... nullReplacement) {

Review Comment:
   fixed it.



##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/BuiltInFunctionDefinitions.java:
##########
@@ -285,6 +286,20 @@ ANY, and(logical(LogicalTypeRoot.BOOLEAN), LITERAL)
                             "org.apache.flink.table.runtime.functions.scalar.ArrayUnionFunction")
                     .build();
 
+    public static final BuiltInFunctionDefinition ARRAY_JOIN =
+            BuiltInFunctionDefinition.newBuilder()
+                    .name("ARRAY_JOIN")
+                    .kind(SCALAR)
+                    .inputTypeStrategy(
+                            varyingSequence(
+                                    new ArrayOfStringArgumentTypeStrategy("ARRAY<STRING>"),
+                                    logical(LogicalTypeFamily.CHARACTER_STRING),
+                                    logical(LogicalTypeFamily.CHARACTER_STRING)))

Review Comment:
   fixed it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org