morrySnow commented on code in PR #10678:
URL: https://github.com/apache/doris/pull/10678#discussion_r915824951
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/SortInfo.java:
##########
@@ -63,6 +63,7 @@ public class SortInfo {
// sortTupleDesc_.
private List<Expr> sortTupleSlotExprs;
+
Review Comment:
useless blank line
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java:
##########
@@ -362,6 +403,19 @@ private TupleDescriptor generateTupleDesc(List<Slot>
slotList, PlanTranslatorCon
return tupleDescriptor;
}
+ private TupleDescriptor generateTupleDesc(List<Slot> slotList,
List<OrderKey> orderKeyList,
Review Comment:
if we plan a query 'select a,b,c from t order by a'. will this generate a
tuple like 'a, a, b, c'?
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java:
##########
@@ -255,7 +279,24 @@ public PlanFragment
visitPhysicalSort(PhysicalUnaryPlan<PhysicalHeapSort, Plan>
return mergeFragment;
}
- // TODO: 1. support shuffle join / co-locate / bucket shuffle join later
+ /**
+ * Populate the SortTupleSlotExprs member.
+ */
+ private void createSortTupleSlotExprs(SortInfo info,
+ TupleDescriptor tupleDescriptor,
+ List<Expr> outputList, List<Expr> orderingExpr) {
+ List<Expr> sortTupleSlotExprs = new ArrayList<>();
+ Set<ExprId> exprIds = new HashSet<>();
+ outputList.addAll(orderingExpr);
+ for (Expr expr : outputList) {
+ if (!exprIds.contains(expr)) {
Review Comment:
exprIds never update. and use ExprId compare with Expr
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]