kevinjmh commented on a change in pull request #3839:
URL: https://github.com/apache/carbondata/pull/3839#discussion_r453393117



##########
File path: 
integration/spark/src/test/scala/org/apache/carbondata/view/MVTest.scala
##########
@@ -63,6 +63,30 @@ class MVTest extends QueryTest with BeforeAndAfterAll {
     sql("drop table source")
   }
 
+  test("test disable mv with carbonproperties and sessionparam") {
+    assert(CarbonProperties.getInstance().isMVEnabled)
+    sql("drop materialized view if exists mv1")
+    sql("drop table if exists source")
+    sql("create table source as select * from fact_table")
+    sql("create materialized view mv1 as select empname, deptname, avg(salary) 
from source group by empname, deptname")
+
+    
CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_ENABLE_QUERYWITHMV,"false")
+    var df = sql("select empname, avg(salary) from source group by empname")
+    assert(!isTableAppearedInPlan(df.queryExecution.optimizedPlan, "mv1"))
+
+    df = sql("select empname, avg(salary) from source group by empname")
+    
CarbonProperties.getInstance().removeProperty(CarbonCommonConstants.CARBON_ENABLE_QUERYWITHMV)
+    assert(isTableAppearedInPlan(df.queryExecution.optimizedPlan, "mv1"))
+
+    sql("set carbon.mv.enable = false")

Review comment:
       not consist with the property name added. And I think this one is better 
than `carbon.enable.querywithmv`




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


Reply via email to