snuyanzin commented on code in PR #26707:
URL: https://github.com/apache/flink/pull/26707#discussion_r2160509150
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/rules/logical/JoinToMultiJoinRule.java:
##########
@@ -289,53 +283,41 @@ private void buildNullGenFieldList(RelNode rel,
List<Boolean> isNullGenFieldList
* @param left left input into join
* @param right right input into join
* @param projFieldsList returns a list of the new combined projection
fields
- * @param joinFieldRefCountsList returns a list of the new combined join
field reference counts
* @return combined left and right inputs in an array
*/
private List<RelNode> combineInputs(
Join join,
RelNode left,
RelNode right,
List<ImmutableBitSet> projFieldsList,
- List<int[]> joinFieldRefCountsList,
- List<Boolean> inputNullGenFieldList) {
+ List<int[]> joinFieldRefCountsList) {
final List<RelNode> newInputs = new ArrayList<>();
- // Leave the null generating sides of an outer join intact; don't pull
up those children
- // inputs into the array we're constructing.
- JoinInfo joinInfo = join.analyzeCondition();
- ImmutableIntList leftKeys = joinInfo.leftKeys;
- ImmutableIntList rightKeys = joinInfo.rightKeys;
- if (canCombine(left, join)) {
- final MultiJoin leftMultiJoin = (MultiJoin) left;
- for (int i = 0; i < leftMultiJoin.getInputs().size(); i++) {
- newInputs.add(leftMultiJoin.getInput(i));
- projFieldsList.add(leftMultiJoin.getProjFields().get(i));
- joinFieldRefCountsList.add(
-
leftMultiJoin.getJoinFieldRefCountsMap().get(i).toIntArray());
- }
+ combineIfCan(join, left, newInputs, projFieldsList,
joinFieldRefCountsList);
+ combineIfCan(join, right, newInputs, projFieldsList,
joinFieldRefCountsList);
- } else {
- newInputs.add(left);
- projFieldsList.add(null);
- joinFieldRefCountsList.add(new
int[left.getRowType().getFieldCount()]);
- }
Review Comment:
logic is identical, so extracted into `combineIfCan`
--
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]