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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]