You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "miland-db (via GitHub)" <gi...@apache.org> on 2025/10/09 18:26:58 UTC
[PR] [SPARK-53857] Enable messageTemplate propagation to SparkThrowable [spark]
miland-db opened a new pull request, #52559:
URL: https://github.com/apache/spark/pull/52559
### What changes were proposed in this pull request?
This pull request enhances Spark error handling capabilities, primarily within `AnalysisException`, to support more flexible and maintainable error message rendering.
### Why are the changes needed?
The goal is to add a new default method, `getDefaultMessageTemplate`, to the public `SparkThrowable` interface. This gives clients a consistent, machine-readable default template for error rendering, while leaving them free to localize or otherwise transform the message.
This approach helps create a single source of truth for error definitions.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Unit tests and existing tests.
### Was this patch authored or co-authored using generative AI tooling?
No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-53857] Enable messageTemplate propagation to SparkThrowable [spark]
Posted by "miland-db (via GitHub)" <gi...@apache.org>.
miland-db commented on code in PR #52559:
URL: https://github.com/apache/spark/pull/52559#discussion_r2420228007
##########
common/utils/src/main/scala/org/apache/spark/SparkThrowableHelper.scala:
##########
@@ -61,6 +66,20 @@ private[spark] object SparkThrowableHelper {
s"$prefix$displayMessage$displaySqlState$displayQueryContext"
}
+ def getMessage(
Review Comment:
I introduced `formatErrorMessage` that contains shared code from `getMessage` methods.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-53857] Enable messageTemplate propagation to SparkThrowable [spark]
Posted by "miland-db (via GitHub)" <gi...@apache.org>.
miland-db commented on PR #52559:
URL: https://github.com/apache/spark/pull/52559#issuecomment-3387051949
Adding @cloud-fan, @dejankrak-db, @yuchenhuo, @davidm-db
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-53857] Enable messageTemplate propagation to SparkThrowable [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on PR #52559:
URL: https://github.com/apache/spark/pull/52559#issuecomment-3401975520
thanks, merging to master!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-53857] Enable messageTemplate propagation to SparkThrowable [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on PR #52559:
URL: https://github.com/apache/spark/pull/52559#issuecomment-3399674335
the code style check failed, can you fix it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-53857] Enable messageTemplate propagation to SparkThrowable [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan closed pull request #52559: [SPARK-53857] Enable messageTemplate propagation to SparkThrowable
URL: https://github.com/apache/spark/pull/52559
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-53857] Enable messageTemplate propagation to SparkThrowable [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on code in PR #52559:
URL: https://github.com/apache/spark/pull/52559#discussion_r2419469825
##########
common/utils/src/main/scala/org/apache/spark/SparkThrowableHelper.scala:
##########
@@ -61,6 +66,20 @@ private[spark] object SparkThrowableHelper {
s"$prefix$displayMessage$displaySqlState$displayQueryContext"
}
+ def getMessage(
Review Comment:
can we share some code between this and the other overload? e.g. we can have a `private def buildMessage` that takes the `displayMessage`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-53857] Enable messageTemplate propagation to SparkThrowable [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on PR #52559:
URL: https://github.com/apache/spark/pull/52559#issuecomment-3397228791
We need to fix the binary compatibility issuse detected by mima.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-53857] Enable messageTemplate propagation to SparkThrowable [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on code in PR #52559:
URL: https://github.com/apache/spark/pull/52559#discussion_r2419478054
##########
sql/api/src/main/scala/org/apache/spark/sql/AnalysisException.scala:
##########
@@ -61,6 +63,33 @@ class AnalysisException protected (
context = context,
cause = cause)
+ /**
+ * External constructor for callers that want to supply NERF fields directly,
Review Comment:
```suggestion
* External constructor for callers that want to supply error fields directly,
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org