gustavodemorais commented on code in PR #28199:
URL: https://github.com/apache/flink/pull/28199#discussion_r3274306829


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/ToChangelogTestPrograms.java:
##########
@@ -184,6 +184,37 @@ public class ToChangelogTestPrograms {
                     .runSql("INSERT INTO sink SELECT * FROM TO_CHANGELOG(input 
=> TABLE t)")
                     .build();
 
+    public static final TableTestProgram UPSERT_PARTITION_BY =

Review Comment:
   Added



##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/TraitCondition.java:
##########
@@ -68,4 +70,30 @@ static TraitCondition not(final TraitCondition condition) {
         return new BuiltInCondition(
                 BuiltInCondition.Kind.NOT, List.of(condition), ctx -> 
!condition.test(ctx));
     }
+
+    /**
+     * True when the named {@code MAP<STRING, STRING>} scalar argument has a 
key that, after
+     * splitting on comma and trimming each part, equals {@code key}. Returns 
true when the argument
+     * is omitted, on the assumption that an absent argument means the 
function falls back to a
+     * default that includes all keys.
+     */
+    @SuppressWarnings("rawtypes")
+    static TraitCondition mapArgIncludesKey(final String argName, final String 
key) {
+        return new BuiltInCondition(
+                BuiltInCondition.Kind.MAP_ARG_INCLUDES_KEY,
+                List.of(argName, key),
+                ctx ->
+                        ctx.getScalarArgument(argName, Map.class)
+                                .map(map -> mapKeysContain(map, key))
+                                .orElse(true));
+    }
+
+    /** True when any key in {@code map}, split on comma and trimmed, equals 
{@code expected}. */
+    private static boolean mapKeysContain(final Map<?, ?> map, final String 
expected) {

Review Comment:
   done



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to