[CARBONDATA-4202] Fix issue when refresh main table with MV
authorShreelekhyaG <shreelu_gampa@yahoo.com>
Fri, 4 Jun 2021 09:25:13 +0000 (14:55 +0530)
committerIndhumathi27 <indhumathim27@gmail.com>
Thu, 10 Jun 2021 07:59:27 +0000 (13:29 +0530)
commit90841bc10860efd5a1417b19cc649f1d483dca07
tree1023086fec8d2e08a2b0838096bc534bd8492167
parentcfa02dd3db2906750aeef2ebc657a1c4f58b2d66
[CARBONDATA-4202] Fix issue when refresh main table with MV

Why is this PR needed?
When trying to register a table of old store which has MV, it fails parser
error(syntax issue while creating table). It is trying to create table with
relatedmvtablesmap property which is not valid.

What changes were proposed in this PR?
1. Removed relatedmvtablesmap from table properties in RefreshCarbonTableCommand
2. After Main table has registered, to register MV made changes to get the schema
   from the system folder and register.

Does this PR introduce any user interface change?
No

Is any new testcase added?
Yes

This closes #4147
core/src/main/java/org/apache/carbondata/core/view/MVManager.java
core/src/main/java/org/apache/carbondata/core/view/MVProvider.java
integration/spark/src/main/scala/org/apache/carbondata/view/MVCatalogInSpark.scala
integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/RefreshCarbonTableCommand.scala
integration/spark/src/main/scala/org/apache/spark/sql/execution/command/view/CarbonRefreshMVCommand.scala
integration/spark/src/test/scala/org/apache/spark/carbondata/register/TestRegisterCarbonTable.scala