xiaokang commented on code in PR #26093:
URL: https://github.com/apache/doris/pull/26093#discussion_r1376050539


##########
fe/fe-core/src/main/java/org/apache/doris/planner/OriginalPlanner.java:
##########
@@ -491,19 +491,69 @@ private void pushSortToOlapScan() {
     // this opt will only work with nereidsPlanner
     private void pushOutColumnUniqueIdsToOlapScan(PlanFragment rootFragment, 
Analyzer analyzer) {
         Set<Integer> outputColumnUniqueIds = new HashSet<>();
-        // add '-1' to avoid the optimization incorrect work with 
OriginalPlanner,
-        // because in the storage layer will skip this optimization if 
outputColumnUniqueIds contains '-1',
-        // to ensure the optimization only correct work with nereidsPlanner
-        outputColumnUniqueIds.add(-1);
+        if 
(ConnectContext.get().getSessionVariable().enableIndexDataReadOptOnOrigPlanner) 
{
+            ArrayList<Expr> outputExprs = rootFragment.getOutputExprs();
+            for (Expr expr : outputExprs) {
+                if (expr instanceof SlotRef) {

Review Comment:
   process expr recursively to add all SlotRef to outputColumnUniqueIds



-- 
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]

Reply via email to