carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jack...@apache.org
Subject [carbondata] branch master updated: [HOTFIX] Fix testcase failure after #3528
Date Sun, 05 Jan 2020 09:29:40 GMT
This is an automated email from the ASF dual-hosted git repository.

jackylk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/carbondata.git


The following commit(s) were added to refs/heads/master by this push:
     new 467acfc  [HOTFIX] Fix testcase failure after #3528
467acfc is described below

commit 467acfca5b63ed5a75bbe1b212f705f5b5bbff81
Author: ajantha-bhat <ajanthabhat@gmail.com>
AuthorDate: Sun Jan 5 15:58:10 2020 +0800

    [HOTFIX] Fix testcase failure after #3528
    
    Why is this PR needed?
    
    PR#3528 was an old build, test was not ran on the latest master. Hence one test case failed.
    
    What changes were proposed in this PR?
    
    updated the test case, as now update by value flow is introduced in 3528 for subquires.
Exception callstack will be different.
    
    Does this PR introduce any user interface change?
    
    No
    
    Is any new testcase added?
    
    No
    
    This closes #3563
---
 .../spark/testsuite/iud/UpdateCarbonTableTestCase.scala | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/iud/UpdateCarbonTableTestCase.scala
b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/iud/UpdateCarbonTableTestCase.scala
index 0f131b1..a551bc8 100644
--- a/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/iud/UpdateCarbonTableTestCase.scala
+++ b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/iud/UpdateCarbonTableTestCase.scala
@@ -159,17 +159,9 @@ class UpdateCarbonTableTestCase extends QueryTest with BeforeAndAfterAll
{
     sql("insert into t2 select 2, 'Andy'")
     sql("insert into t2 select 1, 'aa'")
     sql("insert into t2 select 3, 'aa'")
-    val exception = intercept[RuntimeException] {
+    intercept[AnalysisException] {
       sql("update t1 set (age) = (select t2.age from t2 where t2.name = 'Andy') where t1.age
= 1 ").show(false)
-    }
-    assertResult(
-      "Update operation failed.  update cannot be supported for 1 to N mapping, as more than
one " +
-      "value present for the update key")(exception.getMessage)
-    // Test carbon property
-    CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_UPDATE_CHECK_UNIQUE_VALUE,
"false")
-    // update  should not throw exception
-    sql("update t1 set (age) = (select t2.age from t2 where t2.name = 'Andy') where t1.age
= 1 ").show(false)
-    CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_UPDATE_CHECK_UNIQUE_VALUE,
"true")
+    }.getMessage.contains("update cannot be supported for 1 to N mapping, as more than one
value present for the update key")
     // test join scenario
     val exception1 = intercept[RuntimeException] {
       sql("update t1 set (age) = (select t2.age from t2 where t2.name = t1.name) ").show(false)
@@ -177,6 +169,11 @@ class UpdateCarbonTableTestCase extends QueryTest with BeforeAndAfterAll
{
     assertResult(
       "Update operation failed.  update cannot be supported for 1 to N mapping, as more than
one " +
       "value present for the update key")(exception1.getMessage)
+    // Test carbon property
+    CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_UPDATE_CHECK_UNIQUE_VALUE,
"false")
+    // update  should not throw exception
+    sql("update t1 set (age) = (select t2.age from t2 where t2.name = t1.name) ").show(false)
+    CarbonProperties.getInstance().addProperty(CarbonCommonConstants.CARBON_UPDATE_CHECK_UNIQUE_VALUE,
"true")
     sql("drop table if exists t1")
     sql("drop table if exists t2")
   }


Mime
View raw message