Revert "[fix](fe)project should be done inside subquery (#17716)" (#17774)
This reverts commit db32b251e6a9c3b8307484803af34a0868093e25.
Reverts #17716
This PR may cause `couldn't resolve slot descriptor error.`
diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/NestedLoopJoinNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/NestedLoopJoinNode.java
index 421c534..4f4f0df 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/NestedLoopJoinNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/NestedLoopJoinNode.java
@@ -70,8 +70,8 @@
public NestedLoopJoinNode(PlanNodeId id, PlanNode outer, PlanNode inner, TableRef innerRef) {
super(id, "NESTED LOOP JOIN", StatisticalType.NESTED_LOOP_JOIN_NODE, outer, inner, innerRef);
- tupleIds.addAll(outer.getOutputTupleIds());
- tupleIds.addAll(inner.getOutputTupleIds());
+ tupleIds.addAll(outer.getTupleIds());
+ tupleIds.addAll(inner.getTupleIds());
}
public boolean canParallelize() {
diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/OlapScanNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/OlapScanNode.java
index 582aef8..14577c1 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/OlapScanNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/OlapScanNode.java
@@ -22,7 +22,6 @@
import org.apache.doris.analysis.BinaryPredicate;
import org.apache.doris.analysis.CastExpr;
import org.apache.doris.analysis.Expr;
-import org.apache.doris.analysis.ExprSubstitutionMap;
import org.apache.doris.analysis.InPredicate;
import org.apache.doris.analysis.IntLiteral;
import org.apache.doris.analysis.PartitionNames;
@@ -1244,45 +1243,4 @@
public String getSelectedIndexName() {
return olapTable.getIndexNameById(selectedIndexId);
}
-
- public void setOutputSmap(ExprSubstitutionMap smap, Analyzer analyzer) {
- if (smap.getRhs().stream().anyMatch(expr -> !(expr instanceof SlotRef))) {
- if (outputTupleDesc == null) {
- outputTupleDesc = analyzer.getDescTbl().createTupleDescriptor("OlapScanNode");
- outputTupleDesc.setTable(this.olapTable);
- }
- if (projectList == null) {
- projectList = Lists.newArrayList();
- }
- List<Expr> newRhs = Lists.newArrayList();
- List<Expr> newLhs = Lists.newArrayList();
- for (Expr expr : smap.getRhs()) {
- if (expr instanceof SlotRef && !((SlotRef) expr).getDesc().isMaterialized()) {
- continue;
- }
- if (outputSmap.mappingForRhsExpr(expr) != null) {
- newLhs.add(outputSmap.mappingForRhsExpr(expr));
- newRhs.add(expr);
- } else {
- SlotDescriptor slotDesc = analyzer.addSlotDescriptor(outputTupleDesc);
- slotDesc.initFromExpr(expr);
- slotDesc.setIsMaterialized(true);
- slotDesc.materializeSrcExpr();
- projectList.add(expr);
- newLhs.add(smap.mappingForRhsExpr(expr));
- newRhs.add(new SlotRef(slotDesc));
- }
- }
- outputSmap = new ExprSubstitutionMap(newLhs, newRhs);
- } else {
- outputSmap = smap;
- }
- }
-
- public List<TupleId> getOutputTupleIds() {
- if (outputTupleDesc != null) {
- return Lists.newArrayList(outputTupleDesc.getId());
- }
- return tupleIds;
- }
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/SelectNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/SelectNode.java
index 6d78b5c..2baa6e6 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/SelectNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/SelectNode.java
@@ -32,7 +32,6 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -42,7 +41,7 @@
private static final Logger LOG = LogManager.getLogger(SelectNode.class);
protected SelectNode(PlanNodeId id, PlanNode child, List<Expr> conjuncts) {
- super(id, new ArrayList<>(child.getOutputTupleIds()), "SELECT", StatisticalType.SELECT_NODE);
+ super(id, child.getTupleIds(), "SELECT", StatisticalType.SELECT_NODE);
addChild(child);
this.tblRefIds = child.tblRefIds;
this.nullableTupleIds = child.nullableTupleIds;
diff --git a/regression-test/data/query_p0/group_concat/test_group_concat.out b/regression-test/data/query_p0/group_concat/test_group_concat.out
index e61bd4f..8caca13 100644
--- a/regression-test/data/query_p0/group_concat/test_group_concat.out
+++ b/regression-test/data/query_p0/group_concat/test_group_concat.out
@@ -25,3 +25,4 @@
25699 1989
2147483647 255:1991:32767:32767
+