[GitHub] [carbondata] niuge01 commented on a change in pull request #3692: [CARBONDATA-3776] Clean old materialized view implementation

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

[GitHub] [carbondata] niuge01 commented on a change in pull request #3692: [CARBONDATA-3776] Clean old materialized view implementation

GitBox

niuge01 commented on a change in pull request #3692:
URL: https://github.com/apache/carbondata/pull/3692#discussion_r412826384



##########
File path: integration/spark/src/test/scala/org/apache/carbondata/view/timeseries/TestMVTimeSeriesLoadAndQuery.scala
##########
@@ -230,75 +228,67 @@ class TestMVTimeSeriesLoadAndQuery extends QueryTest with BeforeAndAfterAll {
     checkPlan("mv1", df1)
     val df2 = sql("select distinct(timeseries(projectjoindate,'month')) from maintable")
     checkPlan("mv1", df2)
-    // TODO: cast expression and group by not allowing to create indexSchema, check later
+    // TODO: cast expression and group by not allowing to create mv, check later
 //    sql(
 //      "create materialized view mv2 as " +
 //      "select timeseries(projectjoindate,'month'),cast(floor((projectcode + 1000) / 900) * 900 - 2000 AS INT) from maintable group by timeseries(projectjoindate,'month'),projectcode")
 //    val df3 = sql("select timeseries(projectjoindate,'month'),cast(floor((projectcode + 1000) / 900) * 900 - 2000 AS INT) from maintable group by timeseries(projectjoindate,'month'),projectcode")
 //    checkPlan("mv2", df3)
-    dropMaterializedView("mv1")
+    dropMV("mv1")
   }
 
   test("test mvtimeseries with alias") {
-    val result = sql("select timeseries(projectjoindate,'month'),projectcode from maintable group by timeseries(projectjoindate,'month'),projectcode")
-    dropMaterializedView("mv1")
+    dropMV("mv1")
     sql(
       "create materialized view mv1 as " +
       "select timeseries(projectjoindate,'month') as t,projectcode as y from maintable group by timeseries(projectjoindate,'month'),projectcode")
     loadData("maintable")
     val df1 = sql("select timeseries(projectjoindate,'month') as t,projectcode as y from maintable group by timeseries(projectjoindate,'month'),projectcode")
     checkPlan("mv1", df1)
-    val df2 = sql("select timeseries(projectjoindate,'month'),projectcode from maintable group by timeseries(projectjoindate,'month'),projectcode")
-    checkPlan("mv1", df2)
-    checkAnswer(result, df2)
-    val df4 = sql("select timeseries(projectjoindate,'month'),projectcode as y from maintable group by timeseries(projectjoindate,'month'),projectcode")
-    checkPlan("mv1", df4)
-    dropMaterializedView("mv1")
+    // TODO: fix the base issue of alias with group by
+    //   val df2 = sql("select timeseries(projectjoindate,'month'),projectcode from maintable group by timeseries(projectjoindate,'month'),projectcode")
+    //   checkPlan("mv1", df2)
+    dropMV("mv1")
     sql(
       "create materialized view mv1 as " +
       "select timeseries(projectjoindate,'month'),projectcode from maintable group by timeseries(projectjoindate,'month'),projectcode")
     val df3 = sql("select timeseries(projectjoindate,'month') as t,projectcode as y from maintable group by timeseries(projectjoindate,'month'),projectcode")
     checkPlan("mv1", df3)
-    dropMaterializedView("mv1")
+    dropMV("mv1")
   }
 
   test("test mv timeseries with case when and Sum + Sum") {
-    dropMaterializedView("mv1")
+    dropMV("mv1")
     sql(
       "create materialized view mv1 as " +
       "select timeseries(projectjoindate,'month') ,sum(CASE WHEN projectcode=5 THEN salary ELSE 0 END)  from maintable group by timeseries(projectjoindate,'month')")
     val df = sql("select timeseries(projectjoindate,'month') ,sum(CASE WHEN projectcode=5 THEN salary ELSE 0 END)  from maintable group by timeseries(projectjoindate,'month')")
     checkPlan("mv1", df)
-    dropMaterializedView("mv1")
+    dropMV("mv1")
     sql(
       "create materialized view mv1 as " +
       "select timeseries(projectjoindate,'hour') ,sum(projectcode) + sum(salary)  from maintable group by timeseries(projectjoindate,'hour')")
     loadData("maintable")
     val df1 = sql("select timeseries(projectjoindate,'hour') ,sum(projectcode) + sum(salary)  from maintable group by timeseries(projectjoindate,'hour')")
     checkPlan("mv1", df1)
-    dropMaterializedView("mv1")
+    dropMV("mv1")
   }
 
   test("test mv timeseries with IN filter subquery") {
-    dropMaterializedView("mv1")
+    dropMV("mv1")
     sql(
       "create materialized view mv1 as " +
       "select timeseries(projectjoindate,'hour') ,sum(projectcode)  from maintable group by timeseries(projectjoindate,'hour')")
     val df = sql("select max(salary) from maintable where projectcode IN (select sum(projectcode)  from maintable group by timeseries(projectjoindate,'hour')) ")
     checkPlan("mv1", df)
-    dropMaterializedView("mv1")
+    dropMV("mv1")
   }
 
   test("test mv timeseries duplicate columns and constant columns") {
     // new optimized insert into flow doesn't support duplicate column names, so send it to old flow
     CarbonProperties.getInstance()
       .addProperty(CarbonCommonConstants.CARBON_ENABLE_BAD_RECORD_HANDLING_FOR_INSERT, "true")
-    dropMaterializedView("mv1")
-    intercept[MalformedMVCommandException] {

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