twalthr commented on code in PR #29419:
URL: https://github.com/apache/flink/pull/29419#discussion_r4220456132
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/physical/stream/StreamPhysicalProcessTableFunction.java:
##########
@@ -371,6 +371,46 @@ private static void verifyInputSize(TableConfig
tableConfig, int providedInputAr
// Shared utilities
//
--------------------------------------------------------------------------------------------
+ /**
+ * Derives per-input {@link InputProperty}s. Broadcast table arguments
require a broadcast
+ * distribution, all other inputs use the default.
+ */
+ 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());
+ }
+
+ /** Returns whether the given signature declares a table argument with
broadcast semantics. */
+ public static boolean hasBroadcastTables(List<StaticArgument> staticArgs) {
+ return staticArgs.stream()
+ .anyMatch(arg ->
arg.is(StaticArgumentTrait.BROADCAST_SEMANTIC_TABLE));
+ }
+
+ /**
+ * Returns a flag per input indicating whether it is a table argument with
broadcast semantics.
+ */
+ public static boolean[] broadcastByInput(RexCall call, int inputCount) {
Review Comment:
I feel this is a micro optimization with little impact. Given that we limit
inputs to 20. Boolean is easier for debugging.
--
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]