This is an automated email from the ASF dual-hosted git repository.
indhumuthumurugesh 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 d5cb011 [CARBONDATA-4217] Fix rename SI table, other applications
didn't get reflected issue
d5cb011 is described below
commit d5cb011b634092d063bbc6fa0cfd4c230607da40
Author: jack86596 <[email protected]>
AuthorDate: Sun Jun 20 00:52:58 2021 +0800
[CARBONDATA-4217] Fix rename SI table, other applications didn't get
reflected issue
Why is this PR needed?
After one application rename SI table, other application cannot be reflected
of this change, which leads to query on SI column failed.
What changes were proposed in this PR?
After update index info of parent table, persist schema info so that other
applications can refresh table metadata in time.
This closes #4155
---
.../sql/execution/command/schema/CarbonAlterTableRenameCommand.scala | 2 ++
.../src/main/scala/org/apache/spark/sql/index/CarbonIndexUtil.scala | 1 -
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git
a/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableRenameCommand.scala
b/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableRenameCommand.scala
index ad4f831..4b8b1a4 100644
---
a/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableRenameCommand.scala
+++
b/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableRenameCommand.scala
@@ -156,6 +156,8 @@ private[sql] case class CarbonAlterTableRenameCommand(
originalIndexStatusBeforeDisable, newTableName)(sparkSession)
metastore.lookupRelation(Some(oldDatabaseName),
newTableName)(sparkSession)
.asInstanceOf[CarbonRelation]
+ AlterTableUtil.updateSchemaInfo(parentTable, null,
+ metastore.getThriftTableInfo(parentTable))(sparkSession)
} else {
val alterTableRenamePostEvent: AlterTableRenamePostEvent =
AlterTableRenamePostEvent(
carbonTable,
diff --git
a/integration/spark/src/main/scala/org/apache/spark/sql/index/CarbonIndexUtil.scala
b/integration/spark/src/main/scala/org/apache/spark/sql/index/CarbonIndexUtil.scala
index 2fcc268..5e9e0da 100644
---
a/integration/spark/src/main/scala/org/apache/spark/sql/index/CarbonIndexUtil.scala
+++
b/integration/spark/src/main/scala/org/apache/spark/sql/index/CarbonIndexUtil.scala
@@ -472,7 +472,6 @@ object CarbonIndexUtil {
indexName, newIndexName, status.name())
}
val newIndexInfo = table.getIndexInfo
- indexMetadata.updateIndexStatus(indexType.getIndexProviderName,
indexName, status.name())
table.getTableInfo
.getFactTable
.getTableProperties