Kejian-Li commented on a change in pull request #3947:
URL: https://github.com/apache/carbondata/pull/3947#discussion_r495520426



##########
File path: 
integration/spark/src/test/scala/org/apache/carbondata/view/timeseries/TestCreateMVWithTimeSeries.scala
##########
@@ -167,18 +182,24 @@ class TestCreateMVWithTimeSeries extends QueryTest with 
BeforeAndAfterAll {
 
   test("insert and create materialized view in progress") {
     sql("drop materialized view if exists mv1")
-    val query = s"LOAD DATA local inpath '$resourcesPath/data_big.csv' INTO 
TABLE maintable  " +
-                s"OPTIONS('DELIMITER'= ',')"
-    val executorService = Executors.newFixedThreadPool(4)
-    executorService.submit(new QueryTask(query))
-    intercept[UnsupportedOperationException] {
-      sql(
-        "create materialized view mv1 as " +
+
+    val future = AsyncExecutorUtils.runSqlAsync("insert overwrite table 
maintable select * from temp_maintable")
+    val ex = intercept[UnsupportedOperationException] {
+      sql("create materialized view mv1 as " +
         "select timeseries(projectjoindate,'year'), sum(projectcode) from 
maintable group by timeseries(projectjoindate,'year')")
-    }.getMessage
-      .contains("Cannot create mv materialized view table when insert is in 
progress on parent table: maintable")
-    executorService.shutdown()
-    executorService.awaitTermination(2, TimeUnit.HOURS)
+    }
+    assert(future.get.contains("PASS"))
+    assert(ex.getMessage.contains("Cannot create mv when insert overwrite is 
in progress on table default_maintable"))
+    sql("drop materialized view if exists mv1")
+  }
+
+  test("create materialized view should success when parent table is insert in 
progress") {
+    sql("drop materialized view if exists mv1")
+
+    val future = AsyncExecutorUtils.runSqlAsync("insert into table maintable 
select * from temp_maintable")
+    sql("create materialized view mv1 as " +

Review comment:
       done




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


Reply via email to