This is an automated email from the ASF dual-hosted git repository.
kunalkapoor 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 d4466fd [CARBONDATA-3948] Fix for Bloom Index create failure
d4466fd is described below
commit d4466fd3692f819b31192abccd1c95c67ddfb35d
Author: Vikram Ahuja <[email protected]>
AuthorDate: Wed May 27 01:35:47 2020 +0530
[CARBONDATA-3948] Fix for Bloom Index create failure
Why is this PR needed?
In the case when the whole flow goes to fallback mode in the
index server, the parent table retrieved again in the processData
function of carboncreateIndexCommand does not contain the serialized
IndexMetaData. This issue is only seen in spark-sql because the same
jvm is used between driver and executor
What changes were proposed in this PR?
Setting the index information in parent table after the table is
retrieved again and creating it if it is null
This closes #3775
---
.../execution/command/index/CarbonCreateIndexCommand.scala | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git
a/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/CarbonCreateIndexCommand.scala
b/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/CarbonCreateIndexCommand.scala
index 8ecf107..5d52ed7 100644
---
a/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/CarbonCreateIndexCommand.scala
+++
b/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/CarbonCreateIndexCommand.scala
@@ -238,8 +238,18 @@ case class CarbonCreateIndexCommand(
false)
val enabledIndexInfo = IndexTableInfo.enableIndex(indexInfo,
indexModel.indexName)
- // set index information in parent table
- val parentIndexMetadata = parentTable.getIndexMetadata
+ // set index information in parent table. Create it if it is null.
+ val parentIndexMetadata = if (
+ parentTable.getTableInfo.getFactTable.getTableProperties
+ .get(parentTable.getCarbonTableIdentifier.getTableId) != null)
{
+ parentTable.getIndexMetadata
+ } else {
+ val tempIndexMetaData = new IndexMetadata(false)
+ tempIndexMetaData.addIndexTableInfo(indexProviderName,
+ indexModel.indexName,
+ indexSchema.getProperties)
+ tempIndexMetaData
+ }
parentIndexMetadata.updateIndexStatus(indexProviderName,
indexModel.indexName,
IndexStatus.ENABLED.name())