Skip to content

Commit

Permalink
optimize filed name
Browse files Browse the repository at this point in the history
  • Loading branch information
seawinde committed Sep 4, 2024
1 parent 0ed53bf commit 8246727
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public class StatementContext implements Closeable {
private List<PlannerHook> plannerHooks = new ArrayList<>();

// Identify now is RBO during materialized view rewrite or not, such as in rewrite, we should not check privilege
private boolean rboInMaterializedViewRewrite = false;
private boolean rboForMaterializedViewRewrite = false;

public StatementContext() {
this(ConnectContext.get(), null, 0);
Expand Down Expand Up @@ -431,12 +431,12 @@ public Map<RelationId, Statistics> getRelationIdToStatisticsMap() {
return relationIdToStatisticsMap;
}

public boolean isRboInMaterializedViewRewrite() {
return rboInMaterializedViewRewrite;
public boolean isRboForMaterializedViewRewrite() {
return rboForMaterializedViewRewrite;
}

public void setRboInMaterializedViewRewrite(boolean rboInMaterializedViewRewrite) {
this.rboInMaterializedViewRewrite = rboInMaterializedViewRewrite;
public void setRboForMaterializedViewRewrite(boolean rboForMaterializedViewRewrite) {
this.rboForMaterializedViewRewrite = rboForMaterializedViewRewrite;
}

/** addTableReadLock */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ public static Plan rewriteByRules(
cascadesContext.getStatementContext(), rewrittenPlan,
cascadesContext.getCurrentJobContext().getRequiredProperties());
try {
rewrittenPlanContext.getConnectContext().getStatementContext().setRboInMaterializedViewRewrite(true);
rewrittenPlanContext.getConnectContext().getStatementContext().setRboForMaterializedViewRewrite(true);
rewrittenPlan = planRewriter.apply(rewrittenPlanContext);
} finally {
rewrittenPlanContext.getConnectContext().getStatementContext().setRboInMaterializedViewRewrite(false);
rewrittenPlanContext.getConnectContext().getStatementContext().setRboForMaterializedViewRewrite(false);
}
Map<ExprId, Slot> exprIdToNewRewrittenSlot = Maps.newLinkedHashMap();
for (Slot slot : rewrittenPlan.getOutput()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class CheckPrivileges extends ColumnPruning {

@Override
public Plan rewriteRoot(Plan plan, JobContext jobContext) {
if (jobContext.getCascadesContext().getStatementContext().isRboInMaterializedViewRewrite()) {
if (jobContext.getCascadesContext().getStatementContext().isRboForMaterializedViewRewrite()) {
// During RBO in materialized view rewrite, should not check privileges, because the table query used
// already checked in RBO early, and should not check the privilege of mv which is used in rewrite;
return plan;
Expand Down

0 comments on commit 8246727

Please sign in to comment.