[GitHub] [carbondata] qiuchenjian commented on issue #3080: [CARBONDATA-3256] Fix that MV datamap doesn't take effect using avg expression and count expression

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] qiuchenjian commented on issue #3080: [CARBONDATA-3256] Fix that MV datamap doesn't take effect using avg expression and count expression

GitBox
qiuchenjian commented on issue #3080: [CARBONDATA-3256] Fix that MV datamap doesn't take effect using avg expression and count expression
URL: https://github.com/apache/carbondata/pull/3080#issuecomment-489382097
 
 
   @ravipesala
   hi,  
   1,illustrate that sum expression is height column, and count avg expression is age column  My mv of test case
   2,does you mean that if we use avg expression, we must create mv datamap with sum and count expression ?  But blow testcase is not right in common carbon version
   
   ```
     test("test avg mv") {
       sql("drop table if exists test_table")
       sql("create table test_table(name string, age int, height int,weight int) stored by 'carbondata'")
       sql("insert into test_table select 'tom',20,175,130")
       sql("insert into test_table select 'tom',22,185,150")
       sql("create datamap test_table_mv using 'mv' as select sum(age),count(age),name from test_table group by name")
       sql("rebuild datamap test_table_mv")
       val frame = sql("select count(age),avg(age),name from test_table group by name")
       val analyzed = frame.queryExecution.analyzed
       assert(verifyMVDataMap(analyzed, "test_table_mv"))
       checkAnswer(sql("select avg(age),name from test_table group by name"),
         Seq(Row(21.0, "tom")))
       sql("drop table if exists test_table")
     }
   ```

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services