Skip to content

Commit

Permalink
Add default value not constant error
Browse files Browse the repository at this point in the history
  • Loading branch information
urosstan-db committed Jun 13, 2024
1 parent a00c115 commit 2db7863
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common/utils/src/main/resources/error/error-classes.json
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,11 @@
"which requires <expectedType> type, but the statement provided a value of incompatible <actualType> type."
]
},
"NOT_CONSTANT" : {
"message" : [
"which is not a constant expression whose equivalent value is known at query planning time."
]
},
"SUBQUERY_EXPRESSION" : {
"message" : [
"which contains subquery expressions."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3406,6 +3406,19 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase with Compilat
"defaultValue" -> defaultValue))
}

def defaultValueNotConstantError(
statement: String,
colName: String,
defaultValue: String): Throwable = {
new AnalysisException(
errorClass = "INVALID_DEFAULT_VALUE.NOT_CONSTANT",
messageParameters = Map(
"statement" -> toSQLStmt(statement),
"colName" -> toSQLId(colName),
"defaultValue" -> defaultValue
))
}

def nullableColumnOrFieldError(name: Seq[String]): Throwable = {
new AnalysisException(
errorClass = "NULLABLE_COLUMN_OR_FIELD",
Expand Down

0 comments on commit 2db7863

Please sign in to comment.