This is an automated email from the ASF dual-hosted git repository. maxgekk pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push: new 4a238cd9d8e [SPARK-43257][SQL] Replace the error class _LEGACY_ERROR_TEMP_2022 by an internal error 4a238cd9d8e is described below commit 4a238cd9d8e80eed06732fc52b1456cb5ece6652 Author: 庞贝 <jinhelin....@alibaba-inc.com> AuthorDate: Thu Apr 27 15:01:37 2023 +0300 [SPARK-43257][SQL] Replace the error class _LEGACY_ERROR_TEMP_2022 by an internal error ### What changes were proposed in this pull request? Change the error class_LEGACY_ERROR_TEMP_2022 to internal error as it cannot be accessed. ### Why are the changes needed? Fix jira issue [SPARK-43257](https://issues.apache.org/jira/browse/SPARK-43257). `ResolveNaturalAndUsingJoin` only handles `UsingJoin` and `NaturalJoin`, and all join types supported by `UsingJoin` and `NaturalJoin` are supported by natural join, so `commonNaturalJoinProcessing` will never go to the default branch and throw `unsupportedNaturalJoinTypeError`. I think this error class could be replaced with internal error. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Already exist tests. Closes #40957 from JinHelin404/spark-43257. Authored-by: 庞贝 <jinhelin....@alibaba-inc.com> Signed-off-by: Max Gekk <max.g...@gmail.com> --- core/src/main/resources/error/error-classes.json | 5 ----- .../scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala | 7 +++---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/core/src/main/resources/error/error-classes.json b/core/src/main/resources/error/error-classes.json index 370508b70a8..38502171a0a 100644 --- a/core/src/main/resources/error/error-classes.json +++ b/core/src/main/resources/error/error-classes.json @@ -3796,11 +3796,6 @@ "Couldn't find a primary constructor on <cls>." ] }, - "_LEGACY_ERROR_TEMP_2022" : { - "message" : [ - "Unsupported natural join type <joinType>." - ] - }, "_LEGACY_ERROR_TEMP_2023" : { "message" : [ "Unresolved encoder expected, but <attr> was found." diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala index 6c4066e638c..e77f575b89e 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala @@ -469,10 +469,9 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase { messageParameters = Map("cls" -> cls.toString())) } - def unsupportedNaturalJoinTypeError(joinType: JoinType): SparkRuntimeException = { - new SparkRuntimeException( - errorClass = "_LEGACY_ERROR_TEMP_2022", - messageParameters = Map("joinType" -> joinType.toString())) + def unsupportedNaturalJoinTypeError(joinType: JoinType): SparkException = { + SparkException.internalError( + s"Unsupported natural join type ${joinType.toString}") } def notExpectedUnresolvedEncoderError(attr: AttributeReference): SparkRuntimeException = { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org