Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions common/utils/src/main/resources/error/error-conditions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5920,6 +5920,12 @@
],
"sqlState" : "42803"
},
"MISSING_STATIC_PARTITION_COLUMN" : {
"message" : [
"Static partition column <staticName> is not found in the table."
],
"sqlState" : "42703"
},
"MISSING_TIMEOUT_CONFIGURATION" : {
"message" : [
"The operation has timed out, but no timeout duration is configured. To set a processing time-based timeout, use 'GroupState.setTimeoutDuration()' in your 'mapGroupsWithState' or 'flatMapGroupsWithState' operation. For event-time-based timeout, use 'GroupState.setTimeoutTimestamp()' and define a watermark using 'Dataset.withWatermark()'."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,9 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase with Compilat
}

def missingStaticPartitionColumn(staticName: String): Throwable = {
SparkException.internalError(s"Unknown static partition column: $staticName.")
new AnalysisException(
errorClass = "MISSING_STATIC_PARTITION_COLUMN",
messageParameters = Map("staticName" -> toSQLId(staticName)))
}

def staticPartitionInUserSpecifiedColumnsError(staticName: String): Throwable = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,17 @@ class QueryCompilationErrorsSuite
}
}

test("SPARK-38743: MISSING_STATIC_PARTITION_COLUMN") {
val e = intercept[AnalysisException] {
throw QueryCompilationErrors.missingStaticPartitionColumn("p")
}
checkError(
exception = e,
condition = "MISSING_STATIC_PARTITION_COLUMN",
parameters = Map("staticName" -> "`p`"),
sqlState = Some("42703"))
}

test("UNTYPED_SCALA_UDF: use untyped Scala UDF should fail by default") {
checkError(
exception = intercept[AnalysisException](udf((x: Int) => x, IntegerType)),
Expand Down