kasakrisz opened a new pull request #2030:
URL: https://github.com/apache/hive/pull/2030


   ### What changes were proposed in this pull request?
   1. Replace ConcurrentMap.compute to computeIfAbsent in 
MaterializedViewsCache.putIfAbsent
   2. Add a new version of `HiveMaterializedViewsRegistry.refresh()`
   3. When rebuilding Instead of adding a new instance of the same MV refresh 
the existing one in the cache.
   
   ### Why are the changes needed?
   Using ConcurrentMap.compute enabled adding multiple entries of the same 
Materialization instance to the sqlText -> materialization map.
   `HiveMaterializedViewsRegistry.refresh(HiveConf conf, Table 
oldMaterializedViewTable, Table materializedViewTable)` did not removed 
outdated cache entry since a newer version of the passed table object was 
loaded from MetaStore in `MaterializedViewUpdateOperation`.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   ```
   mvn test -Dtest=TestMaterializedViewsCache -pl ql
   mvn test -Dtest.output.overwrite -DskipSparkTests 
-Dtest=TestMiniLlapLocalCliDriver -Dqfile=materialized_view_create_rewrite_3.q 
-pl itests/qtest -Pitests
   ```


----------------------------------------------------------------
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to