This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
commit 2181a293408e1992067b4bad51811863be85970e Author: feiniaofeiafei <[email protected]> AuthorDate: Tue Apr 16 19:09:06 2024 +0800 (Fix)(nereids) modify create view privilege check error message (#33669) --- .../doris/nereids/trees/plans/commands/info/CreateViewInfo.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateViewInfo.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateViewInfo.java index 6edca0a9877..084fe3af3f4 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateViewInfo.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateViewInfo.java @@ -106,8 +106,6 @@ public class CreateViewInfo { /**validate*/ public void validate(ConnectContext ctx) throws UserException { - NereidsPlanner planner = new NereidsPlanner(ctx.getStatementContext()); - planner.plan(new UnboundResultSink<>(logicalQuery), PhysicalProperties.ANY, ExplainLevel.NONE); viewName.analyze(ctx); FeNameFormat.checkTableName(viewName.getTbl()); // disallow external catalog @@ -115,8 +113,11 @@ public class CreateViewInfo { // check privilege if (!Env.getCurrentEnv().getAccessManager().checkTblPriv(ctx, new TableName(viewName.getCtl(), viewName.getDb(), viewName.getTbl()), PrivPredicate.CREATE)) { - ErrorReport.reportAnalysisException(ErrorCode.ERR_SPECIFIC_ACCESS_DENIED_ERROR, "CREATE"); + ErrorReport.reportAnalysisException(ErrorCode.ERR_TABLE_ACCESS_DENIED_ERROR, + PrivPredicate.CREATE.getPrivs().toString(), viewName.getTbl()); } + NereidsPlanner planner = new NereidsPlanner(ctx.getStatementContext()); + planner.plan(new UnboundResultSink<>(logicalQuery), PhysicalProperties.ANY, ExplainLevel.NONE); Set<String> colSets = Sets.newTreeSet(String.CASE_INSENSITIVE_ORDER); for (Column col : finalCols) { if (!colSets.add(col.getName())) { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
