Skip to content

Commit

Permalink
rename code
Browse files Browse the repository at this point in the history
  • Loading branch information
seawinde committed Apr 11, 2024
1 parent 7af70c8 commit c58ae47
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,13 @@ protected List<Plan> doRewrite(StructInfo queryStructInfo, CascadesContext casca
}
Plan rewrittenPlan;
Plan mvScan = materializationContext.getMvScanPlan();
Plan originalPlan = queryStructInfo.getTopPlan();
Plan topPlan = queryStructInfo.getTopPlan();
if (compensatePredicates.isAlwaysTrue()) {
rewrittenPlan = mvScan;
} else {
// Try to rewrite compensate predicates by using mv scan
List<Expression> rewriteCompensatePredicates = rewriteExpression(compensatePredicates.toList(),
originalPlan, materializationContext.getMvExprToMvScanExprMapping(),
topPlan, materializationContext.getMvExprToMvScanExprMapping(),
viewToQuerySlotMapping, true, queryStructInfo.getTableBitSet());
if (rewriteCompensatePredicates.isEmpty()) {
materializationContext.recordFailReason(queryStructInfo,
Expand All @@ -223,13 +223,13 @@ protected List<Plan> doRewrite(StructInfo queryStructInfo, CascadesContext casca
if (rewrittenPlan == null) {
continue;
}
final Plan finalRewrittenPlan = rewriteByRules(cascadesContext, rewrittenPlan, originalPlan);
if (!isOutputValid(originalPlan, finalRewrittenPlan)) {
final Plan finalRewrittenPlan = rewriteByRules(cascadesContext, rewrittenPlan, topPlan);
if (!isOutputValid(topPlan, finalRewrittenPlan)) {
materializationContext.recordFailReason(queryStructInfo,
"RewrittenPlan output logical properties is different with target group",
() -> String.format("planOutput logical"
+ " properties = %s,\n groupOutput logical properties = %s",
finalRewrittenPlan.getLogicalProperties(), originalPlan.getLogicalProperties()));
finalRewrittenPlan.getLogicalProperties(), topPlan.getLogicalProperties()));
continue;
}
// check the partitions used by rewritten plan is valid or not
Expand Down

0 comments on commit c58ae47

Please sign in to comment.