You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/02/26 03:01:39 UTC

[GitHub] [hive] jcamachor commented on a change in pull request #2013: HIVE-24820: MaterializedViewCache enables adding multiple entries of the same Materialization instance

jcamachor commented on a change in pull request #2013:
URL: https://github.com/apache/hive/pull/2013#discussion_r583351336



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/metadata/MaterializedViewsCache.java
##########
@@ -80,52 +80,11 @@ public void putIfAbsent(Table materializedViewTable, HiveRelOptMaterialization m
     return dbMap;
   }
 
-  public void refresh(
-          Table oldMaterializedViewTable, Table materializedViewTable, HiveRelOptMaterialization newMaterialization) {
-    ConcurrentMap<String, HiveRelOptMaterialization> dbMap = ensureDbMap(materializedViewTable);
-
-    dbMap.compute(materializedViewTable.getTableName(), (mvTableName, existingMaterialization) -> {
-      List<HiveRelOptMaterialization> optMaterializationList = sqlToMaterializedView.computeIfAbsent(
-              materializedViewTable.getViewExpandedText(), s -> new ArrayList<>());
+  public void refresh(Table materializedViewTable, HiveRelOptMaterialization newMaterialization) {
+    remove(materializedViewTable.getDbName(), materializedViewTable.getTableName());

Review comment:
       What happens with concurrency in this case, e.g., an MV is refreshed concurrently by another user? I think that was the main reason to have the logic within a single operation.
   We were also checking whether the old version was actually the same and only replacing in that case, but we do not do that anymore. Shouldn't we keep that check?




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org