Indhumathi27 commented on a change in pull request #4216:
URL: https://github.com/apache/carbondata/pull/4216#discussion_r708157522
##########
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:
Same code is present in CarbonParserUtil.processSpatialIndexProperty.
Please move to common place and reuse
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]