[SPARK-36293][SQL] Refactor fourth set of 20 query execution errors to use error classes#34190
[SPARK-36293][SQL] Refactor fourth set of 20 query execution errors to use error classes#34190dchvn wants to merge 2 commits intoapache:masterfrom
Conversation
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Test build #143865 has finished for PR 34190 at commit
|
|
Test build #143988 has started for PR 34190 at commit |
|
Kubernetes integration test starting |
|
Test build #143965 has finished for PR 34190 at commit
|
|
Test build #143973 has finished for PR 34190 at commit
|
|
Kubernetes integration test status failure |
|
CC @karenfeng, please help me review this one, many thanks! |
| "CANNOT_DROP_OBJECT_DUE_TO_FAILED_DIRECTORY_DELETION" : { | ||
| "message" : [ "Unable to DROP %s %s as failed to delete its directory %s." ] | ||
| }, | ||
| "CANNOT_EVALUATE_EXPRESSION" : { |
There was a problem hiding this comment.
These aren't from this PR, right?
| "CANNOT_EVALUATE_EXPRESSION" : { | ||
| "message" : [ "Cannot evaluate expression: %s" ] | ||
| }, | ||
| "CANNOT_GENERATE_CODE_FOR_EXPRESSION" : { |
There was a problem hiding this comment.
These aren't from this PR, right?
|
|
||
| def failedToCompileMsg(e: Exception): String = { | ||
| s"failed to compile: $e" | ||
| SparkThrowableHelper.getMessage( |
There was a problem hiding this comment.
@cloud-fan, are all of these compilation failures internal errors?
| def notADatasourceRDDPartitionError(split: Partition): Throwable = { | ||
| new SparkException(s"[BUG] Not a DataSourceRDDPartition: $split") | ||
| new SparkException( | ||
| errorClass = "NOT_A_DATA_SOURCE_RDD_PARTITION", |
There was a problem hiding this comment.
This is an internal error; let's use INTERNAL_ERROR
| "CONCURRENT_QUERY" : { | ||
| "message" : [ "Another instance of this query was just started by a concurrent session." ] | ||
| }, | ||
| "DATA_PATH_NOT_SPECIFIED" : { |
There was a problem hiding this comment.
Let's call this MISSING_DATA_PATH?
|
|
||
| def methodNotImplementedError(methodName: String): Throwable = { | ||
| new UnsupportedOperationException(s"$methodName is not implemented") | ||
| new SparkUnsupportedOperationException( |
There was a problem hiding this comment.
It looks like this is actually only used by a dummy implementation and should not be exposed to users. Can you make this an internal error?
| def tableStatsNotSpecifiedError(): Throwable = { | ||
| new IllegalStateException("table stats must be specified.") | ||
| new SparkIllegalStateException( | ||
| errorClass = "TABLE_STATISTICS_NOT_SPECIFIED", |
There was a problem hiding this comment.
@cloud-fan, is this an internal error? I can't know a use case where the user encounters this.
| "message" : [ "%s cannot be represented as Decimal(%s, %s)." ], | ||
| "sqlState" : "22005" | ||
| }, | ||
| "CANNOT_CREATE_OBJECT_DUE_TO_FAILED_DIRECTORY_CREATION" : { |
There was a problem hiding this comment.
Actually, what if we just have three error classes: CANNOT_CREATE_DIRECTORY, CANNOT_DELETE_DIRECTORY and CANNOT_RENAME_DIRECTORY? This would be more concise and can be used more generally as well. Then we can make the error message like Cannot %s as failed to create directory %s.
|
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
What changes were proposed in this pull request?
Refactor some exceptions in QueryExecutionErrors to use error classes.
There are currently ~350 exceptions in this file; so this PR only focuses on the fourth set of 20.
Why are the changes needed?
https://issues.apache.org/jira/browse/SPARK-36094
Does this PR introduce any user-facing change?
No
How was this patch tested?
Pass all current tests