Indhumathi27 commented on a change in pull request #3497: [CARBONDATA-3602]Fix MV issues with session level operations
URL: https://github.com/apache/carbondata/pull/3497#discussion_r355237671 ########## File path: datamap/mv/core/src/test/scala/org/apache/carbondata/mv/rewrite/MVCreateTestCase.scala ########## @@ -316,14 +316,37 @@ class MVCreateTestCase extends QueryTest with BeforeAndAfterAll { } test("test create datamap with simple join") { + sql("create database if not exists db1") + sql("create database if not exists db2") + sql("use db1") + sql("drop table if exists fact_table1") + sql( + """ + | CREATE TABLE fact_table1 (empname String, designation String, doj Timestamp, + | workgroupcategory int, workgroupcategoryname String, deptno int, deptname String, + | projectcode int, projectjoindate Timestamp, projectenddate Timestamp,attendance int, + | utilization int,salary int) + | STORED BY 'org.apache.carbondata.format' + """.stripMargin) + sql("use db2") + sql("drop table if exists fact_table2") + sql( + """ + | CREATE TABLE fact_table2 (empname String, designation String, doj Timestamp, + | workgroupcategory int, workgroupcategoryname String, deptno int, deptname String, + | projectcode int, projectjoindate Timestamp, projectenddate Timestamp,attendance int, + | utilization int,salary int) + | STORED BY 'org.apache.carbondata.format' + """.stripMargin) sql("drop datamap if exists datamap21") - sql("create datamap datamap21 using 'mv' as select t1.empname as c1, t2.designation, t2.empname as c2 from fact_table1 t1 inner join fact_table2 t2 on (t1.empname = t2.empname)") + sql("create datamap datamap21 using 'mv' as select t1.empname as c1, t2.designation, t2.empname as c2 from db1.fact_table1 t1 inner join fact_table2 t2 on (t1.empname = t2.empname)") val frame = sql( - "select t1.empname as c1, t2.designation from fact_table1 t1,fact_table2 t2 where t1.empname = t2.empname") - val analyzed = frame.queryExecution.analyzed - assert(TestUtil.verifyMVDataMap(analyzed, "datamap21")) - checkAnswer(frame, sql("select t1.empname, t2.designation from fact_table4 t1,fact_table5 t2 where t1.empname = t2.empname")) - sql(s"drop datamap datamap21") + "select t1.empname as c1, t2.designation from db1.fact_table1 t1,fact_table2 t2 where t1.empname = t2.empname") +// val analyzed = frame.queryExecution.analyzed Review comment: Please uncomment these lines and add validation ---------------------------------------------------------------- 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 |
Free forum by Nabble | Edit this page |