Skip to content

Commit

Permalink
Sonar: remove duplicate field
Browse files Browse the repository at this point in the history
  • Loading branch information
kasakrisz committed Oct 16, 2024
1 parent 5125e58 commit 8be8d5a
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5379,9 +5379,6 @@ class OrderByRelBuilder {

private HiveRelDistribution hiveRelDistribution;
private RelNode obInputRel;
private RowResolver selectOutputRR;
private RelNode srcRel;


OrderByRelBuilder(
CalcitePlannerAction calcitePlannerAction, Pair<RelNode, RowResolver> selPair, boolean outermostOB) {
Expand Down Expand Up @@ -5555,8 +5552,7 @@ private void genOBProject() throws SemanticException {
// selPair.getKey() is the operator right before OB
// selPair.getValue() is RR which only contains columns needed in result
// set. Extra columns needed by order by will be absent from it.
srcRel = selPair.getKey();
selectOutputRR = selPair.getValue();
RelNode srcRel = selPair.getKey();
RowResolver inputRR = calcitePlannerAction.relToHiveRR.get(srcRel);

// 3. Add Child Project Rel if needed, Generate Output RR, input Sel Rel
Expand Down Expand Up @@ -5640,8 +5636,9 @@ private RelNode endGenOBLogicalPlan(RelNode sortRel) throws CalciteSemanticExcep
calcitePlannerAction.relToHiveRR.put(sortRel, outputRR);
calcitePlannerAction.relToHiveColNameCalcitePosMap.put(sortRel, hiveColNameCalcitePosMap);

RowResolver selectOutputRR = selPair.getValue();
if (selectOutputRR != null) {
List<RexNode> originalInputRefs = calcitePlannerAction.toRexNodeList(srcRel);
List<RexNode> originalInputRefs = calcitePlannerAction.toRexNodeList(selPair.getKey());
List<RexNode> selectedRefs = originalInputRefs.subList(0, selectOutputRR.getColumnInfos().size());
// We need to add select since order by schema may have more columns than result schema.
return calcitePlannerAction.genSelectRelNode(selectedRefs, selectOutputRR, sortRel);
Expand Down

0 comments on commit 8be8d5a

Please sign in to comment.