diff --git a/core/trino-main/src/main/java/io/trino/sql/analyzer/StatementAnalyzer.java b/core/trino-main/src/main/java/io/trino/sql/analyzer/StatementAnalyzer.java index 0cd35c67451b..638aaad2739a 100644 --- a/core/trino-main/src/main/java/io/trino/sql/analyzer/StatementAnalyzer.java +++ b/core/trino-main/src/main/java/io/trino/sql/analyzer/StatementAnalyzer.java @@ -526,10 +526,10 @@ protected Scope visitRefreshMaterializedView(RefreshMaterializedView refreshMate } accessControl.checkCanRefreshMaterializedView(session.toSecurityContext(), name); + analysis.setUpdateType("REFRESH MATERIALIZED VIEW"); if (metadata.delegateMaterializedViewRefreshToConnector(session, name)) { analysis.setDelegatedRefreshMaterializedView(name); - analysis.setUpdateType("REFRESH MATERIALIZED VIEW"); analysis.setUpdateTarget( name, Optional.empty(), @@ -590,7 +590,6 @@ protected Scope visitRefreshMaterializedView(RefreshMaterializedView refreshMate .map(Type::toString), Column::new); - analysis.setUpdateType("REFRESH MATERIALIZED VIEW"); analysis.setUpdateTarget( targetTable, Optional.empty(),