Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ private PlanNode createScanNode(Analyzer analyzer, TableRef tblRef, SelectStmt s
if ((tblRef.getJoinOp().isInnerJoin() || tblRef.getJoinOp().isLeftOuterJoin())) {
List<Expr> allConjuncts = analyzer.getConjuncts(analyzer.getAllTupleIds());
allConjuncts.removeAll(conjuncts);
for (Expr conjunct: allConjuncts) {
for (Expr conjunct : allConjuncts) {
if (org.apache.doris.analysis.Predicate.canPushDownPredicate(conjunct)) {
for (Expr eqJoinPredicate : eqJoinPredicates) {
// we can ensure slot is left node, because NormalizeBinaryPredicatesRule
Expand Down Expand Up @@ -1473,7 +1473,7 @@ private Expr rewritePredicate(Analyzer analyzer, Expr oldPredicate, Expr leftChi

if (oldPredicate instanceof InPredicate) {
InPredicate oldIP = (InPredicate) oldPredicate;
InPredicate ip = new InPredicate(leftChild, oldIP.getListChildren(), oldIP.isNotIn());
InPredicate ip = new InPredicate(leftChild, oldIP.getListChildren(), oldIP.isNotIn());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
InPredicate ip = new InPredicate(leftChild, oldIP.getListChildren(), oldIP.isNotIn());
InPredicate inPredicate = new InPredicate(leftChild, oldIP.getListChildren(), oldIP.isNotIn());

ip.analyzeNoThrow(analyzer);
return ip;
}
Expand Down Expand Up @@ -1898,10 +1898,11 @@ private void materializeTableResultForCrossJoinOrCountStar(TableRef tblRef, Anal
* Inner tuple: tuple 0 with a not materialized slot k1
* In the above two cases, it is necessary to add a mini column to the inner tuple
* to ensure that the number of rows in the inner query result is the number of rows in the table.
*
* <p>
* After this function, the inner tuple is following:
* case1. tuple 0: slot<k1> materialized true (new slot)
* case2. tuple 0: slot<k1> materialized true (changed)
*
* @param tblRef
* @param analyzer
*/
Expand All @@ -1915,9 +1916,14 @@ private void materializeSlotForEmptyMaterializedTableRef(BaseTableRef tblRef, An
}
}
if (minimuColumn != null) {
SlotDescriptor slot = analyzer.getDescTbl().addSlotDescriptor(tblRef.getDesc());
slot.setColumn(minimuColumn);
slot.setIsMaterialized(true);
SlotDescriptor slot = tblRef.getDesc().getColumnSlot(minimuColumn.getName());
if (slot != null) {
slot.setIsMaterialized(true);
} else {
slot = analyzer.getDescTbl().addSlotDescriptor(tblRef.getDesc());
slot.setColumn(minimuColumn);
slot.setIsMaterialized(true);
}
}
}
}
Expand Down Expand Up @@ -2087,7 +2093,7 @@ private List<Expr> getPredicatesBoundedByGroupbysSourceExpr(List<Expr> predicate
} else {
// if grouping type is GROUPING_SETS and the predicate not in all grouping list,
// the predicate cannot be push down
for (List<Expr> exprs: stmt.getGroupByClause().getGroupingSetList()) {
for (List<Expr> exprs : stmt.getGroupByClause().getGroupingSetList()) {
if (!exprs.contains(sourceExpr)) {
isAllSlotReferingGroupBys = false;
break;
Expand Down