killxdcj opened a new issue #5583:
URL: https://github.com/apache/incubator-doris/issues/5583


   Forget to copy realchildren when initializing GroupingFunctionCallExpr 
through the copy constructor
   
   >     public GroupingFunctionCallExpr(GroupingFunctionCallExpr other) {
   >         super(other);
   >         this.childrenReseted = other.childrenReseted;
   >     }
   
   realchildren should be copy too?
   
   >     public GroupingFunctionCallExpr(GroupingFunctionCallExpr other) {
   >         super(other);
   >         this.childrenReseted = other.childrenReseted;
   >         if (this.childrenReseted) {
   >             this.realChildren = Expr.cloneList(other.realChildren);
   >         }
   >     }
   
   NPE will throwed when run the fllowing sql
   
   >     SELECT  col1,
   >             IF(GROUPING(`col1`) = 1, COUNT(col1), 0) AS class_count,
   >             col2,
   >             IF(GROUPING(`col2`) = 1, COUNT(col2), 0) AS school_count
   >     FROM    test
   >     GROUP BY
   >             GROUPING SETS(
   >                 (col1, col2),
   >                 (col1)
   >             )
   
   Exception Stack
   
   > 2021-03-30 21:28:56,089 WARN (doris-mysql-nio-pool-11567|122281) 
[StmtExecutor.analyze():467] Analyze failed because
   > java.lang.NullPointerException: null
   >    at java.util.ArrayList.addAll(ArrayList.java:701) ~[?:?]
   >    at 
org.apache.doris.analysis.GroupingFunctionCallExpr.reset(GroupingFunctionCallExpr.java:92)
 ~[palo-fe.jar:?]
   >    at org.apache.doris.analysis.Expr.reset(Expr.java:926) ~[palo-fe.jar:?]
   >    at org.apache.doris.analysis.Expr.reset(Expr.java:926) ~[palo-fe.jar:?]
   >    at 
org.apache.doris.analysis.SelectListItem.<init>(SelectListItem.java:49) 
~[palo-fe.jar:?]
   >    at 
org.apache.doris.analysis.SelectListItem.clone(SelectListItem.java:58) 
~[palo-fe.jar:?]
   >    at org.apache.doris.analysis.SelectList.<init>(SelectList.java:45) 
~[palo-fe.jar:?]
   >    at org.apache.doris.analysis.SelectList.clone(SelectList.java:104) 
~[palo-fe.jar:?]
   >    at org.apache.doris.analysis.SelectStmt.<init>(SelectStmt.java:151) 
~[palo-fe.jar:?]
   >    at org.apache.doris.analysis.SelectStmt.clone(SelectStmt.java:190) 
~[palo-fe.jar:?]
   >    at 
org.apache.doris.analysis.InlineViewRef.<init>(InlineViewRef.java:99) 
~[palo-fe.jar:?]
   >    at 
org.apache.doris.analysis.Analyzer.resolveTableRef(Analyzer.java:480) 
~[palo-fe.jar:?]
   >    at org.apache.doris.analysis.FromClause.analyze(FromClause.java:130) 
~[palo-fe.jar:?]
   >    at org.apache.doris.analysis.SelectStmt.analyze(SelectStmt.java:343) 
~[palo-fe.jar:?]
   >    at 
org.apache.doris.qe.StmtExecutor.analyzeAndGenerateQueryPlan(StmtExecutor.java:485)
 ~[palo-fe.jar:?]
   >    at org.apache.doris.qe.StmtExecutor.analyze(StmtExecutor.java:455) 
~[palo-fe.jar:?]
   >    at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:243) 
~[palo-fe.jar:?]
   >    at 
org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:193) 
~[palo-fe.jar:?]
   >    at 
org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:325) 
~[palo-fe.jar:?]
   >    at 
org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:510) 
~[palo-fe.jar:?]
   >    at 
org.apache.doris.mysql.nio.ReadListener.lambda$handleEvent$0(ReadListener.java:50)
 ~[palo-fe.jar:?]
   >    at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 
[?:?]
   >    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 
[?:?]
   >    at java.lang.Thread.run(Thread.java:834) [?:?]


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

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