carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manishgupt...@apache.org
Subject carbondata git commit: [CARBONDATA-2829][CARBONDATA-2832] Fix creating merge index on older V1 V2 store
Date Tue, 07 Aug 2018 08:36:28 GMT
Repository: carbondata
Updated Branches:
  refs/heads/master 40571b846 -> b702a1b01


[CARBONDATA-2829][CARBONDATA-2832] Fix creating merge index on older V1 V2 store

Block merge index creation for the old store V1 V2 versions

This closes #2608


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

Branch: refs/heads/master
Commit: b702a1b01414308de710c1d1471a064184843c37
Parents: 40571b8
Author: dhatchayani <dhatcha.official@gmail.com>
Authored: Mon Aug 6 12:15:26 2018 +0530
Committer: manishgupta88 <tomanishgupta18@gmail.com>
Committed: Tue Aug 7 14:10:44 2018 +0530

----------------------------------------------------------------------
 .../management/CarbonAlterTableCompactionCommand.scala    | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/b702a1b0/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonAlterTableCompactionCommand.scala
----------------------------------------------------------------------
diff --git a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonAlterTableCompactionCommand.scala
b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonAlterTableCompactionCommand.scala
index a4adbbb..e0b0547 100644
--- a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonAlterTableCompactionCommand.scala
+++ b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonAlterTableCompactionCommand.scala
@@ -37,6 +37,7 @@ import org.apache.carbondata.core.constants.CarbonCommonConstants
 import org.apache.carbondata.core.datastore.impl.FileFactory
 import org.apache.carbondata.core.exception.ConcurrentOperationException
 import org.apache.carbondata.core.locks.{CarbonLockFactory, LockUsage}
+import org.apache.carbondata.core.metadata.ColumnarFormatVersion
 import org.apache.carbondata.core.metadata.schema.table.{CarbonTable, TableInfo}
 import org.apache.carbondata.core.mutate.CarbonUpdateUtil
 import org.apache.carbondata.core.statusmanager.SegmentStatusManager
@@ -122,6 +123,15 @@ case class CarbonAlterTableCompactionCommand(
           "Unsupported alter operation on carbon table: Merge index is not supported on streaming"
+
           " table")
       }
+      val version = CarbonUtil.getFormatVersion(table)
+      val isOlderVersion = version == ColumnarFormatVersion.V1 ||
+                           version == ColumnarFormatVersion.V2
+      if (isOlderVersion) {
+        throw new MalformedCarbonCommandException(
+          "Unsupported alter operation on carbon table: Merge index is not supported on V1
V2 " +
+          "store segments")
+      }
+
       val alterTableMergeIndexEvent: AlterTableMergeIndexEvent =
         AlterTableMergeIndexEvent(sparkSession, table, alterTableModel)
       OperationListenerBus.getInstance


Mime
View raw message