deniskuzZ commented on code in PR #6322:
URL: https://github.com/apache/hive/pull/6322#discussion_r2818996240
##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/MaterializedViewMap.java:
##########
@@ -121,23 +114,16 @@ public void refresh(
}
public void remove(Table materializedViewTable) {
- ConcurrentMap<String, HiveRelOptMaterialization> dbMap =
materializedViews.get(materializedViewTable.getDbName());
- if (dbMap != null) {
- // Delete only if the create time for the input materialized view table
and the table
- // in the map match. Otherwise, keep the one in the map.
- dbMap.computeIfPresent(materializedViewTable.getTableName(),
(mvTableName, oldMaterialization) -> {
- Table oldTable =
HiveMaterializedViewUtils.extractTable(oldMaterialization);
- if (materializedViewTable.equals(oldTable)) {
- remove(oldMaterialization, oldTable);
- return null;
- }
- return oldMaterialization;
- });
-
- if (dbMap.isEmpty()) {
- materializedViews.remove(materializedViewTable.getDbName());
+ // Delete only if the create time for the input materialized view table
and the table
Review Comment:
materializedViewTable.equals(oldTable) where is the create time comparison,
maybe update the comment?
##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/MaterializedViewMap.java:
##########
@@ -121,23 +114,16 @@ public void refresh(
}
public void remove(Table materializedViewTable) {
- ConcurrentMap<String, HiveRelOptMaterialization> dbMap =
materializedViews.get(materializedViewTable.getDbName());
- if (dbMap != null) {
- // Delete only if the create time for the input materialized view table
and the table
- // in the map match. Otherwise, keep the one in the map.
- dbMap.computeIfPresent(materializedViewTable.getTableName(),
(mvTableName, oldMaterialization) -> {
- Table oldTable =
HiveMaterializedViewUtils.extractTable(oldMaterialization);
- if (materializedViewTable.equals(oldTable)) {
- remove(oldMaterialization, oldTable);
- return null;
- }
- return oldMaterialization;
- });
-
- if (dbMap.isEmpty()) {
- materializedViews.remove(materializedViewTable.getDbName());
+ // Delete only if the create time for the input materialized view table
and the table
Review Comment:
`materializedViewTable.equals(oldTable)` where is the create time
comparison, maybe update the comment?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]