You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by GitBox <gi...@apache.org> on 2021/09/15 13:24:04 UTC

[GitHub] [carbondata] ShreelekhyaG commented on a change in pull request #4216: [CARBONDATA-4277] geo instance compatability fix

ShreelekhyaG commented on a change in pull request #4216:
URL: https://github.com/apache/carbondata/pull/4216#discussion_r709182359



##########
File path: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/RefreshCarbonTableCommand.scala
##########
@@ -83,6 +84,23 @@ case class RefreshCarbonTableCommand(
       if (FileFactory.isFileExist(schemaFilePath)) {
         // read TableInfo
         val tableInfo = SchemaReader.getTableInfo(identifier)
+        val tableProperties = tableInfo.getFactTable.getTableProperties

Review comment:
       Verified for direct upgrade scenario and update document.

##########
File path: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/RefreshCarbonTableCommand.scala
##########
@@ -83,6 +84,23 @@ case class RefreshCarbonTableCommand(
       if (FileFactory.isFileExist(schemaFilePath)) {
         // read TableInfo
         val tableInfo = SchemaReader.getTableInfo(identifier)
+        val tableProperties = tableInfo.getFactTable.getTableProperties
+        val indexName = tableProperties.get(CarbonCommonConstants.SPATIAL_INDEX)
+        if (indexName != null) {
+          val SPATIAL_INDEX_CLASS = s"${ CarbonCommonConstants.SPATIAL_INDEX }.$indexName.class"
+          val SPATIAL_INDEX_INSTANCE = s"${
+            CarbonCommonConstants.SPATIAL_INDEX
+          }.$indexName.instance"
+          // For spatial table, To make the instance compatible with previous versions,
+          // initialise and update the index instance in table properties.
+          tableProperties.remove(SPATIAL_INDEX_INSTANCE)
+          val spatialIndexClass: Class[_] = java.lang.Class.forName(tableProperties

Review comment:
       Done

##########
File path: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/RefreshCarbonTableCommand.scala
##########
@@ -83,6 +84,23 @@ case class RefreshCarbonTableCommand(
       if (FileFactory.isFileExist(schemaFilePath)) {
         // read TableInfo
         val tableInfo = SchemaReader.getTableInfo(identifier)
+        val tableProperties = tableInfo.getFactTable.getTableProperties
+        val indexName = tableProperties.get(CarbonCommonConstants.SPATIAL_INDEX)
+        if (indexName != null) {
+          val SPATIAL_INDEX_CLASS = s"${ CarbonCommonConstants.SPATIAL_INDEX }.$indexName.class"

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.

To unsubscribe, e-mail: dev-unsubscribe@carbondata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org