snuyanzin commented on code in PR #29987:
URL: https://github.com/apache/flink/pull/29987#discussion_r4599558989


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/physical/stream/StreamPhysicalProcessTableFunction.java:
##########
@@ -372,21 +372,23 @@ private static void verifyInputSize(TableConfig 
tableConfig, int providedInputAr
     // 
--------------------------------------------------------------------------------------------
 
     /**
-     * Derives per-input {@link InputProperty}s. Broadcast table arguments 
require a broadcast
-     * distribution, all other inputs use the default.
+     * Derives per-input {@link InputProperty}s. Table arguments with set or 
broadcast semantics
+     * request a distribution from their input, table arguments with row 
semantics don't.
      */
     private List<InputProperty> deriveInputProperties(RexCall call) {
-        final boolean[] broadcastByInput = broadcastByInput(call, 
getInputs().size());
-        return IntStream.range(0, getInputs().size())
-                .mapToObj(
-                        i ->
-                                broadcastByInput[i]
-                                        ? InputProperty.builder()
-                                                .requiredDistribution(
-                                                        
InputProperty.BROADCAST_DISTRIBUTION)
-                                                .build()
-                                        : InputProperty.DEFAULT)
-                .collect(Collectors.toList());
+        final InputProperty[] inputProperties = new 
InputProperty[getInputs().size()];
+        Arrays.fill(inputProperties, InputProperty.DEFAULT);
+        for (Ord<StaticArgument> tableArg : getProvidedInputArgs(call)) {
+            final boolean requestsDistribution =
+                    tableArg.e.is(StaticArgumentTrait.SET_SEMANTIC_TABLE)
+                            || 
tableArg.e.is(StaticArgumentTrait.BROADCAST_SEMANTIC_TABLE);
+            if (requestsDistribution) {
+                final int inputIndex =
+                        ((RexTableArgCall) 
call.getOperands().get(tableArg.i)).getInputIndex();
+                inputProperties[inputIndex] = 
InputProperty.fromInput(getInput(inputIndex));
+            }
+        }
+        return Arrays.asList(inputProperties);

Review Comment:
   ```suggestion
           return List.of(inputProperties);
   ```
   nit



-- 
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