snuyanzin commented on code in PR #29419:
URL: https://github.com/apache/flink/pull/29419#discussion_r4210432031
##########
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:
Since most of the code is generated I wonder if we can use BitSets which are
more compact
--
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]