Skip to content

Commit

Permalink
Correct error code for analyze column mask
Browse files Browse the repository at this point in the history
  • Loading branch information
hereisharish authored and ebyhr committed Oct 21, 2024
1 parent 86c7113 commit 6adc528
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -5200,15 +5201,15 @@ 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;
try {
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;
Expand Down

0 comments on commit 6adc528

Please sign in to comment.