You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/12/22 12:26:11 UTC

[GitHub] [incubator-doris] blueChild opened a new issue #5121: [Bug]In the 0.13.0-rc03 version, if there no partitions in the table, an NoSuchElementException will be reported when the COUNT() function is used

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


   **Describe the bug**
   
   In the 0.13.0-rc03 version, if there no partitions in the table, the following exception is reported when the COUNT() function is used:
   
   ```
   2020-12-22 15:52:35,871 WARN (doris-mysql-nio-pool-371|735) [StmtExecutor.analyze():466] Analyze failed because
   java.util.NoSuchElementException: No value present
           at java.util.Optional.get(Optional.java:135) ~[?:1.8.0_242]
           at org.apache.doris.catalog.OlapTable.getVisibleIndex(OlapTable.java:375) ~[palo-fe.jar:?]
           at org.apache.doris.catalog.OlapTable.getVisibleIndexIdToMeta(OlapTable.java:367) ~[palo-fe.jar:?]
           at org.apache.doris.catalog.OlapTable.getVisibleColumn(OlapTable.java:380) ~[palo-fe.jar:?]
           at org.apache.doris.rewrite.mvrewrite.CountFieldToSum.apply(CountFieldToSum.java:77) ~[palo-fe.jar:?]
           at org.apache.doris.rewrite.ExprRewriter.applyRuleBottomUp(ExprRewriter.java:85) ~[palo-fe.jar:?]
           at org.apache.doris.rewrite.ExprRewriter.applyRuleRepeatedly(ExprRewriter.java:71) ~[palo-fe.jar:?]
           at org.apache.doris.rewrite.ExprRewriter.rewrite(ExprRewriter.java:55) ~[palo-fe.jar:?]
           at org.apache.doris.analysis.QueryStmt.rewriteQueryExprByMvColumnExpr(QueryStmt.java:254) ~[palo-fe.jar:?]
           at org.apache.doris.analysis.SelectStmt.analyze(SelectStmt.java:369) ~[palo-fe.jar:?]
           at org.apache.doris.qe.StmtExecutor.analyzeAndGenerateQueryPlan(StmtExecutor.java:484) ~[palo-fe.jar:?]
           at org.apache.doris.qe.StmtExecutor.analyze(StmtExecutor.java:454) ~[palo-fe.jar:?]
           at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:242) ~[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:1149) [?:1.8.0_242]
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_242]
           at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
   2020-12-22 15:52:35,871 WARN (doris-mysql-nio-pool-371|735) [StmtExecutor.execute():321] execute Exception. errCode = 2, detailMessage = Unexpected exception: No value present
   
   ```
   
   
   
   **To Reproduce**
   
   Steps to reproduce the behavior:
   
   1. create a table without partitions:
   
      ```mysql
      CREATE TABLE IF NOT EXISTS doris_app_event_record
      (pt_d INT NULL,app VARCHAR(256) NULL,
       event VARCHAR(256)  NULL,
       distribute_id VARCHAR(256)  NULL,
       bitmap_id BITMAP BITMAP_UNION NULL, 
       row_count INT  SUM NULL)
      PARTITION BY RANGE (pt_d) ( ) 
      DISTRIBUTED BY HASH(distribute_id) BUCKETS 3 
      PROPERTIES('replication_num' = '3');
      ```
   
      
   
   2. query the table with count() function:
   
      ```mysql
      mysql> SELECT pt_d FROM doris_app_event_record WHERE pt_d = 20201222;
      Empty set (0.00 sec)
      mysql> SELECT COUNT(*) FROM doris_app_event_record WHERE pt_d = 20201222;
      +----------+
      | count(*) |
      +----------+
      |        0 |
      +----------+
      1 row in set (0.00 sec)
      
      mysql> SELECT COUNT(pt_d) FROM doris_app_event_record WHERE pt_d = 20201222;
      ERROR 1064 (HY000): errCode = 2, detailMessage = Unexpected exception: No value present
      
      ```
   
   
   
   **Expected behavior**
   
   I think the query results of count(pt_d) and count(*) should be the same, as in version 0.12.
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman closed issue #5121: [Bug]In the 0.13.0-rc03 version, if there no partitions in the table, an NoSuchElementException will be reported when the COUNT() function is used

Posted by GitBox <gi...@apache.org>.
morningman closed issue #5121:
URL: https://github.com/apache/incubator-doris/issues/5121


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] blueChild commented on issue #5121: [Bug]In the 0.13.0-rc03 version, if there no partitions in the table, an NoSuchElementException will be reported when the COUNT() function is used

Posted by GitBox <gi...@apache.org>.
blueChild commented on issue #5121:
URL: https://github.com/apache/incubator-doris/issues/5121#issuecomment-755925315


   > @blueChild This is a bug and I'm trying to fix, you can work around by adding at least one partition.
   
   Thanks for your help very much. I reviewed your code, and I think that your changes are exactly what I want. 
   I'm not familiar with this code, so I've been reviewing code for the last few days. Now I'm not sure if this modification is enough to solve the problem. I mean, is there any other code needs to be modified ? Thank you again.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] Xpray commented on issue #5121: [Bug]In the 0.13.0-rc03 version, if there no partitions in the table, an NoSuchElementException will be reported when the COUNT() function is used

Posted by GitBox <gi...@apache.org>.
Xpray commented on issue #5121:
URL: https://github.com/apache/incubator-doris/issues/5121#issuecomment-755981087


   I'm also new to Apache Doris, I tested this case and it worked and now wait for other's feedback


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] EmmyMiao87 commented on issue #5121: [Bug]In the 0.13.0-rc03 version, if there no partitions in the table, an NoSuchElementException will be reported when the COUNT() function is used

Posted by GitBox <gi...@apache.org>.
EmmyMiao87 commented on issue #5121:
URL: https://github.com/apache/incubator-doris/issues/5121#issuecomment-769017436


   This is indeed a problem. I will review your code


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on issue #5121: [Bug]In the 0.13.0-rc03 version, if there no partitions in the table, an NoSuchElementException will be reported when the COUNT() function is used

Posted by GitBox <gi...@apache.org>.
morningman commented on issue #5121:
URL: https://github.com/apache/incubator-doris/issues/5121#issuecomment-749516289


   You can try upgrade to 0.13.12  to see if it still happen.
   https://cloud.baidu.com/doc/PALO/s/Ikivhcwb5


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] blueChild commented on issue #5121: [Bug]In the 0.13.0-rc03 version, if there no partitions in the table, an NoSuchElementException will be reported when the COUNT() function is used

Posted by GitBox <gi...@apache.org>.
blueChild commented on issue #5121:
URL: https://github.com/apache/incubator-doris/issues/5121#issuecomment-749518804


   > You can try upgrade to 0.13.12 to see if it still happen.
   > https://cloud.baidu.com/doc/PALO/s/Ikivhcwb5
   
   ok, I'll try it.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] blueChild commented on issue #5121: [Bug]In the 0.13.0-rc03 version, if there no partitions in the table, an NoSuchElementException will be reported when the COUNT() function is used

Posted by GitBox <gi...@apache.org>.
blueChild commented on issue #5121:
URL: https://github.com/apache/incubator-doris/issues/5121#issuecomment-750003064


   I test it on 0.13.12 release version, the problem is the same:
   ```
   2020-12-23 16:07:47,369 WARN (doris-mysql-nio-pool-1|117) [StmtExecutor.analyze():492] Analyze failed because
   java.util.NoSuchElementException: No value present
           at java.util.Optional.get(Optional.java:135) ~[?:1.8.0_212]
           at org.apache.doris.catalog.OlapTable.getVisibleIndex(OlapTable.java:375) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.catalog.OlapTable.getVisibleIndexIdToMeta(OlapTable.java:367) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.catalog.OlapTable.getVisibleColumn(OlapTable.java:380) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.rewrite.mvrewrite.CountFieldToSum.apply(CountFieldToSum.java:77) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.rewrite.ExprRewriter.applyRuleBottomUp(ExprRewriter.java:110) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.rewrite.ExprRewriter.applyRuleRepeatedly(ExprRewriter.java:96) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.rewrite.ExprRewriter.rewrite(ExprRewriter.java:61) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.analysis.QueryStmt.rewriteQueryExprByMvColumnExpr(QueryStmt.java:255) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.analysis.SelectStmt.analyze(SelectStmt.java:392) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.qe.StmtExecutor.analyzeAndGenerateQueryPlan(StmtExecutor.java:510) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.qe.StmtExecutor.analyze(StmtExecutor.java:480) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:263) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:192) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:324) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:515) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.mysql.nio.ReadListener.lambda$handleEvent$0(ReadListener.java:50) ~[palo-fe.jar:3.4.0]
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212]
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212]
           at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
   2020-12-23 16:07:47,369 WARN (doris-mysql-nio-pool-1|117) [StmtExecutor.execute():345] execute Exception. {}
   org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Unexpected exception: No value present
           at org.apache.doris.qe.StmtExecutor.analyze(StmtExecutor.java:493) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:263) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:192) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:324) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:515) ~[palo-fe.jar:3.4.0]
           at org.apache.doris.mysql.nio.ReadListener.lambda$handleEvent$0(ReadListener.java:50) ~[palo-fe.jar:3.4.0]
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212]
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212]
           at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
   
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] blueChild commented on issue #5121: [Bug]In the 0.13.0-rc03 version, if there no partitions in the table, an NoSuchElementException will be reported when the COUNT() function is used

Posted by GitBox <gi...@apache.org>.
blueChild commented on issue #5121:
URL: https://github.com/apache/incubator-doris/issues/5121#issuecomment-756121161


   > worked
   
   
   
   > I'm also new to Apache Doris, I tested this case and it worked and now wait for other's feedback
   
   ok


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] Xpray commented on issue #5121: [Bug]In the 0.13.0-rc03 version, if there no partitions in the table, an NoSuchElementException will be reported when the COUNT() function is used

Posted by GitBox <gi...@apache.org>.
Xpray commented on issue #5121:
URL: https://github.com/apache/incubator-doris/issues/5121#issuecomment-755338036


   @blueChild  This is a bug and I'm trying to fix, you can work around by adding at least one partition.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org