New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HIVE-28050: Disable Incremental non aggregated materialized view rebuild in presence of delete operations #5053
HIVE-28050: Disable Incremental non aggregated materialized view rebuild in presence of delete operations #5053
Conversation
92b0637
to
0e4f6da
Compare
@@ -480,8 +460,6 @@ protected ASTNode fixUpAfterCbo(ASTNode originalAst, ASTNode newAst, CalcitePlan | |||
fixUpASTAggregateInsertDeleteIncrementalRebuild(fixedAST, getMaterializedViewASTBuilder()); | |||
return fixedAST; | |||
case JOIN_INSERT_DELETE_REBUILD: | |||
fixUpASTJoinInsertDeleteIncrementalRebuild(fixedAST, getMaterializedViewASTBuilder()); | |||
return fixedAST; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will end up throwing the UnsupportedOperationException. Don't we want to fall back to the full rebuild ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point CBO plan is already transformed to AST hence we can not fall back. However JOIN_INSERT_DELETE_REBUILD
is never set in the code any more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, just for my reference, for the non-groupby queries that this patch is addressing, could you point to where the fall back to the full rebuild (using insert-overwrite) happens ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since JOIN_INSERT_DELETE_REBUILD
is not used anymore why not remove it altogether?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
@@ -322,8 +318,7 @@ private RelNode applyRecordIncrementalRebuildPlan( | |||
} | |||
return applyAggregateInsertDeleteIncremental(basePlan, mdProvider, executorProvider); | |||
} else { | |||
return applyJoinInsertDeleteIncremental( | |||
basePlan, mdProvider, executorProvider, optCluster, calcitePreMVRewritingPlan); | |||
return calcitePreMVRewritingPlan; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amansinha100
This is the point where we fall back to full rebuild.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, left few minor comments but feel free to disregard at your discretion.
@@ -480,8 +460,6 @@ protected ASTNode fixUpAfterCbo(ASTNode originalAst, ASTNode newAst, CalcitePlan | |||
fixUpASTAggregateInsertDeleteIncrementalRebuild(fixedAST, getMaterializedViewASTBuilder()); | |||
return fixedAST; | |||
case JOIN_INSERT_DELETE_REBUILD: | |||
fixUpASTJoinInsertDeleteIncrementalRebuild(fixedAST, getMaterializedViewASTBuilder()); | |||
return fixedAST; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since JOIN_INSERT_DELETE_REBUILD
is not used anymore why not remove it altogether?
(1, 'alfred', 10.30, 2), | ||
(1, 'alfred', 10.30, 2), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of modifying existing tests to add duplicates in order to trigger the problem I think it would be better to add a new minimal test like the one you posted last under the JIRA ticket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the 2nd example from the jira as a new q test but I also kept the change of this one because we ususally face extra challenges in case of MVs with Join.
…ild in presence of delete operations
0e4f6da
to
6085bc0
Compare
Quality Gate passedIssues Measures |
What changes were proposed in this pull request?
Remove code of incremental rebuild of materialized views without aggregate in presence of delete operations
Why are the changes needed?
The current implementations leads to data correctness issues when a source table does not have a unique column.
Does this PR introduce any user-facing change?
No.
Is the change a dependency upgrade?
No.
How was this patch tested?