Copilot commented on code in PR #56927:
URL: https://github.com/apache/doris/pull/56927#discussion_r2428004689


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/CheckSearchUsage.java:
##########
@@ -127,4 +131,17 @@ private boolean containsSearchExpression(Expression 
expression) {
         }
         return false;
     }
+
+    private boolean isSingleTableScanPipeline(Plan plan) {
+        Plan current = plan;
+        while (true) {
+            if (current instanceof LogicalOlapScan) {
+                return true;
+            }
+            if (current.arity() != 1) {
+                return false;
+            }
+            current = current.child(0);

Review Comment:
   This method can result in an infinite loop or null pointer exception. The 
while loop lacks a null check for `current.child(0)` and has no termination 
condition if the plan tree doesn't contain a `LogicalOlapScan`. Add a null 
check and ensure proper termination.
   ```suggestion
               Plan next = current.child(0);
               if (next == null) {
                   return false;
               }
               current = next;
   ```



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