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 5bf6bc4f9af8..4954d208640a 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 @@ -324,6 +324,7 @@ import static io.trino.spi.StandardErrorCode.INVALID_ARGUMENTS; import static io.trino.spi.StandardErrorCode.INVALID_CATALOG_PROPERTY; import static io.trino.spi.StandardErrorCode.INVALID_CHECK_CONSTRAINT; +import static io.trino.spi.StandardErrorCode.INVALID_COLUMN_MASK; import static io.trino.spi.StandardErrorCode.INVALID_COLUMN_REFERENCE; import static io.trino.spi.StandardErrorCode.INVALID_COPARTITIONING; import static io.trino.spi.StandardErrorCode.INVALID_FUNCTION_ARGUMENT; @@ -5200,7 +5201,7 @@ private void analyzeColumnMask(String currentIdentity, Table table, QualifiedObj { String column = columnSchema.getName(); if (analysis.hasColumnMask(tableName, column, currentIdentity)) { - throw new TrinoException(INVALID_ROW_FILTER, extractLocation(table), format("Column mask for '%s.%s' is recursive", tableName, column), null); + throw new TrinoException(INVALID_COLUMN_MASK, extractLocation(table), format("Column mask for '%s.%s' is recursive", tableName, column), null); } Expression expression; @@ -5208,7 +5209,7 @@ private void analyzeColumnMask(String currentIdentity, Table table, QualifiedObj expression = sqlParser.createExpression(mask.getExpression()); } catch (ParsingException e) { - throw new TrinoException(INVALID_ROW_FILTER, extractLocation(table), format("Invalid column mask for '%s.%s': %s", tableName, column, e.getErrorMessage()), e); + throw new TrinoException(INVALID_COLUMN_MASK, extractLocation(table), format("Invalid column mask for '%s.%s': %s", tableName, column, e.getErrorMessage()), e); } ExpressionAnalysis expressionAnalysis;