godfreyhe commented on a change in pull request #18707: URL: https://github.com/apache/flink/pull/18707#discussion_r804479757
########## File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/batch/BatchExecExchange.java ########## @@ -126,22 +130,25 @@ public String getDescription() { parallelism = 1; break; case HASH: - int[] keys = ((HashDistribution) inputProperty.getRequiredDistribution()).getKeys(); - RowType inputType = (RowType) inputEdge.getOutputType(); - String[] fieldNames = - Arrays.stream(keys) - .mapToObj(i -> inputType.getFieldNames().get(i)) - .toArray(String[]::new); partitioner = - new BinaryHashPartitioner( - HashCodeGenerator.generateRowHash( - new CodeGeneratorContext(planner.getTableConfig()), - inputEdge.getOutputType(), - "HashPartitioner", - keys), - fieldNames); + createHashPartitioner( + ((HashDistribution) requiredDistribution), inputType, planner); parallelism = ExecutionConfig.PARALLELISM_DEFAULT; break; + case KEEP_INPUT_AS_IS: + RequiredDistribution inputDistribution = + ((KeepInputAsIsDistribution) requiredDistribution).getInputDistribution(); + checkArgument( Review comment: for singleton distribution, I will add the (max) parallelism limitation in ExecNodeBase#translateToPlan -- 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-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org