[
https://issues.apache.org/jira/browse/HIVE-24822?focusedWorklogId=558405&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-558405
]
ASF GitHub Bot logged work on HIVE-24822:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 26/Feb/21 05:28
Start Date: 26/Feb/21 05:28
Worklog Time Spent: 10m
Work Description: kasakrisz merged pull request #2022:
URL: https://github.com/apache/hive/pull/2022
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 558405)
Time Spent: 20m (was: 10m)
> Materialized View rebuild loses materializationTime property value
> ------------------------------------------------------------------
>
> Key: HIVE-24822
> URL: https://issues.apache.org/jira/browse/HIVE-24822
> Project: Hive
> Issue Type: Bug
> Reporter: Krisztian Kasa
> Assignee: Krisztian Kasa
> Priority: Major
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Materialized View rebuild like
> {code}
> alter materialized view mat1 rebuild;
> {code}
> updates the CreationMetadata of a org.apache.hadoop.hive.ql.metadata.Table
> object of the materialized view but it does not copy the materializationTime
> property value from the original CreationMetadata object and updates the
> entry in the MaterializedViewCache:
> {code}
> } else if (desc.isUpdateCreationMetadata()) {
> // We need to update the status of the creation signature
> Table mvTable = context.getDb().getTable(desc.getName());
> CreationMetadata cm = new
> CreationMetadata(MetaStoreUtils.getDefaultCatalog(context.getConf()),
> mvTable.getDbName(), mvTable.getTableName(),
>
> ImmutableSet.copyOf(mvTable.getCreationMetadata().getTablesUsed()));
>
> cm.setValidTxnList(context.getConf().get(ValidTxnWriteIdList.VALID_TABLES_WRITEIDS_KEY));
> context.getDb().updateCreationMetadata(mvTable.getDbName(),
> mvTable.getTableName(), cm);
> mvTable.setCreationMetadata(cm);
>
> HiveMaterializedViewsRegistry.get().createMaterializedView(context.getDb().getConf(),
> mvTable);
> }
> {code}
> Later when loading Materializetions using
> {code}
> Hive.getValidMaterializedViews(List<Table> materializedViewTables ...)
> {code}
> the materialization stored in the cache and in the metastore will be not the
> same because of the lost materializationTime.
> Cache tried to be refreshed
> {code}
> HiveMaterializedViewsRegistry.get().refreshMaterializedView(conf, null,
> materializedViewTable);
> {code}
> by passing null as oldMaterializedViewTable which leads to
> NullPointerException and CBO failure because the registry expect a non null
> oldMaterializedViewTable value:
> It may drops the old MV in Metastore and also tries to update the cache.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)