SWJTU-ZhangLei opened a new issue, #12828:
URL: https://github.com/apache/doris/issues/12828

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### Version
   
   27f7ae258db3b5e48e32f97020567fbbe580b365
   
   ### What's Wrong?
   
   2022-09-21 14:50:22,517 DEBUG (mysql-nio-pool-0|194) 
[MaterializedViewSelector.checkOutputColumns():410] Those mv pass the test of 
output columns:11104
   2022-09-21 14:50:22,517 DEBUG (mysql-nio-pool-0|194) 
[MaterializedViewSelector.selectBestRowCountIndex():255] rowCount=0 for 
table=11104
   2022-09-21 14:50:22,518 DEBUG (mysql-nio-pool-0|194) 
[MaterializedViewSelector.selectBestMV():122] The best materialized view is 
11104 for scan node 00 in query SELECT <slot 5> `store_id` AS `store_id`, <slot 
6> 
hll_union_agg(`default_cluster:regression_test_cloud_alter_clause_p0_alter_table_rollup`.`test_materialized_view_hll`.`mv_hll_union_sale_amt`)
 AS `hll_union_agg(hll_hash(``sale_amt``))` FROM 
`default_cluster:regression_test_cloud_alter_clause_p0_alter_table_rollup`.`test_materialized_view_hll`
 GROUP BY `store_id`, isPreAggregation: true, reasonOfDisable: null, cost 3
   2022-09-21 14:50:22,518 DEBUG (mysql-nio-pool-0|194) 
[OlapScanNode.updateSlotUniqueId():398] baseColumn:`store_id` int(11) NULL, 
mvColumn:`store_id` int(11) NULL
   2022-09-21 14:50:22,519 DEBUG (mysql-nio-pool-0|194) 
[OlapScanNode.updateSlotUniqueId():398] baseColumn:`sale_amt` bigint(20) NULL, 
mvColumn:null
   2022-09-21 14:50:22,519 WARN (mysql-nio-pool-0|194) 
[StmtExecutor.analyze():680] Analyze failed. stmt[72, 
1dec6fc7d6fe491b-83f77957cd1c688e]
   java.lang.NullPointerException: null
           at 
org.apache.doris.analysis.SlotDescriptor.setColumn(SlotDescriptor.java:153) 
~[doris-fe.jar:1.0-SNAPSHOT]
           at 
org.apache.doris.planner.OlapScanNode.updateSlotUniqueId(OlapScanNode.java:399) 
~[doris-fe.jar:1.0-SNAPSHOT]
           at 
org.apache.doris.planner.OlapScanNode.updateScanRangeInfoByNewMVSelector(OlapScanNode.java:338)
 ~[doris-fe.jar:1.0-SNAPSHOT]
           at 
org.apache.doris.planner.SingleNodePlanner.selectMaterializedView(SingleNodePlanner.java:1159)
 ~[doris-fe.jar:1.0-SNAPSHOT]
           at 
org.apache.doris.planner.OriginalPlanner.createPlanFragments(OriginalPlanner.java:168)
 ~[doris-fe.jar:1.0-SNAPSHOT]
           at 
org.apache.doris.planner.OriginalPlanner.plan(OriginalPlanner.java:85) 
~[doris-fe.jar:1.0-SNAPSHOT]
           at 
org.apache.doris.qe.StmtExecutor.analyzeAndGenerateQueryPlan(StmtExecutor.java:825)
 ~[doris-fe.jar:1.0-SNAPSHOT]
           at org.apache.doris.qe.StmtExecutor.analyze(StmtExecutor.java:663) 
~[doris-fe.jar:1.0-SNAPSHOT]
           at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:395) 
~[doris-fe.jar:1.0-SNAPSHOT]
           at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:362) 
~[doris-fe.jar:1.0-SNAPSHOT]
           at 
org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:262) 
~[doris-fe.jar:1.0-SNAPSHOT]
           at 
org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:399) 
~[doris-fe.jar:1.0-SNAPSHOT]
           at 
org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:603) 
~[doris-fe.jar:1.0-SNAPSHOT]
           at 
org.apache.doris.mysql.nio.ReadListener.lambda$handleEvent$0(ReadListener.java:52)
 ~[doris-fe.jar:1.0-SNAPSHOT]
           at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
~[?:1.8.0_131]
           at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
~[?:1.8.0_131]
           at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_131]
   
   ### What You Expected?
   
   without npt
   
   ### How to Reproduce?
   
   suite("test_materialized_view_hll_with_light_sc", "rollup") {
       def tbName1 = "test_materialized_view_hll_with_light_sc"
   
       def getJobState = { tableName ->
           def jobStateResult = sql """  SHOW ALTER TABLE MATERIALIZED VIEW 
WHERE TableName='${tableName}' ORDER BY CreateTime DESC LIMIT 1; """
           return jobStateResult[0][8]
       }
       sql "DROP TABLE IF EXISTS ${tbName1}"
       sql """
               CREATE TABLE ${tbName1}(
                   record_id int, 
                   seller_id int, 
                   store_id int, 
                   sale_date date, 
                   sale_amt bigint
               ) 
               DISTRIBUTED BY HASH(record_id) properties("replication_num" = 
"1", "light_schema_change" = "true");
           """
   
       sql "CREATE materialized VIEW amt_count1 AS SELECT store_id, 
hll_union(hll_hash(sale_amt)) FROM ${tbName1} GROUP BY store_id;"
       max_try_secs = 60
       while (max_try_secs--) {
           String res = getJobState(tbName1)
           if (res == "FINISHED") {
               break
           } else {
               Thread.sleep(2000)
               if (max_try_secs < 1) {
                   println "test timeout," + "state:" + res
                   assertEquals("FINISHED",res)
               }
           }
       }
   
       qt_sql "DESC ${tbName1} ALL;"
   
       sql "insert into ${tbName1} values(1, 1, 1, '2020-05-30',100);"
       sql "insert into ${tbName1} values(2, 1, 1, '2020-05-30',100);"
       qt_sql "SELECT store_id, hll_union_agg(hll_hash(sale_amt)) FROM 
${tbName1} GROUP BY store_id;"
   
       explain {
           sql("SELECT store_id, hll_union_agg(hll_hash(sale_amt)) FROM 
${tbName1} GROUP BY store_id;")
           contains "(amt_count1)"
       }
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: commits-unsubscr...@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to