[CARBONDATA-4206] Support rename SI table
authorjack86596 <jack86596@gmail.com>
Thu, 10 Jun 2021 11:35:39 +0000 (19:35 +0800)
committerIndhumathi27 <indhumathim27@gmail.com>
Wed, 16 Jun 2021 09:20:41 +0000 (14:50 +0530)
commitf1da9e8c155297ea22808e5b01137cd84e9561d9
treebe0f958b12776a2345a9e64c8dcfc0144c4ac9c1
parent90841bc10860efd5a1417b19cc649f1d483dca07
[CARBONDATA-4206] Support rename SI table

Why is this PR needed?
Currently rename SI table can succeed, but after rename, insert and query on main table
failed, throw no such table exception. This is because after SI table renamed, main
table's tblproperties didn't get update, it still stores the old SI table name, when
refering to SI table, it tries to find the SI table by old name, which leads to no such table exception.

What changes were proposed in this PR?
After SI table renamed, update the main table's tblproperties with new SI information.

Does this PR introduce any user interface change?
No

Is any new testcase added?
Yes

This closes #4149
core/src/main/java/org/apache/carbondata/core/metadata/schema/indextable/IndexMetadata.java
integration/spark/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableRenameCommand.scala
integration/spark/src/main/scala/org/apache/spark/sql/index/CarbonIndexUtil.scala
integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/events/AlterTableRenameEventListener.scala
integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/createTable/TestRenameTableWithIndex.scala