carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jack...@apache.org
Subject [2/2] carbondata git commit: [CARBONDATA-1610][Streaming] Reject alter table to disable streaming property
Date Sat, 25 Nov 2017 07:33:13 GMT
[CARBONDATA-1610][Streaming] Reject alter table to disable streaming property

1. Unsupported feature:
ALTER TABLE stream_table_alter UNSET TBLPROPERTIES IF EXISTS ('streaming')
ALTER TABLE stream_table_alter SET TBLPROPERTIES('streaming'='false')

2. supported feature:
ALTER TABLE stream_table_alter SET TBLPROPERTIES('streaming'='true')

This closes #1564


Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/85f03920
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/85f03920
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/85f03920

Branch: refs/heads/master
Commit: 85f039203ce08cc9ff2df1660a2e80b854e3901c
Parents: 19f9e6c
Author: QiangCai <qiangcai@qq.com>
Authored: Sat Nov 25 11:15:28 2017 +0800
Committer: Jacky Li <jacky.likun@qq.com>
Committed: Sat Nov 25 15:32:57 2017 +0800

----------------------------------------------------------------------
 .../org/apache/spark/sql/execution/strategy/DDLStrategy.scala  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/85f03920/integration/spark2/src/main/scala/org/apache/spark/sql/execution/strategy/DDLStrategy.scala
----------------------------------------------------------------------
diff --git a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/strategy/DDLStrategy.scala
b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/strategy/DDLStrategy.scala
index e1f1ef2..bf037d1 100644
--- a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/strategy/DDLStrategy.scala
+++ b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/strategy/DDLStrategy.scala
@@ -156,11 +156,12 @@ class DDLStrategy(sparkSession: SparkSession) extends SparkStrategy
{
       case AlterTableSetPropertiesCommand(tableName, properties, isView)
         if CarbonEnv.getInstance(sparkSession).carbonMetastore
           .tableExists(tableName)(sparkSession) => {
+        // TODO remove this limitation later
         val property = properties.find(_._1.equalsIgnoreCase("streaming"))
         if (property.isDefined) {
           if (!property.get._2.trim.equalsIgnoreCase("true")) {
             throw new MalformedCarbonCommandException(
-              "Unsupported alter table to disable streaming property")
+              "Streaming property can not be changed to 'false' once it is 'true'")
           }
         }
         ExecutedCommandExec(AlterTableSetCommand(tableName, properties, isView)) :: Nil
@@ -168,9 +169,10 @@ class DDLStrategy(sparkSession: SparkSession) extends SparkStrategy {
       case AlterTableUnsetPropertiesCommand(tableName, propKeys, ifExists, isView)
         if CarbonEnv.getInstance(sparkSession).carbonMetastore
           .tableExists(tableName)(sparkSession) => {
+        // TODO remove this limitation later
         if (propKeys.find(_.equalsIgnoreCase("streaming")).isDefined) {
           throw new MalformedCarbonCommandException(
-            "Unsupported alter table to unset streaming properties")
+            "Streaming property can not be removed")
         }
         ExecutedCommandExec(AlterTableUnsetCommand(tableName, propKeys, ifExists, isView))
:: Nil
       }


Mime
View raw message