-
Notifications
You must be signed in to change notification settings - Fork 28.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPARK-1710: spark-submit should print better errors than "InvocationTargetException" #630
Conversation
Merged build triggered. |
Merged build started. |
mainMethod.invoke(null, childArgs.toArray) | ||
} catch { | ||
case e: InvocationTargetException => | ||
println("Exception in Invoked Method" + e.getTargetException) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is going to change behavior in two ways though. This will not print any stack trace, and the exception will not propagated up to main() where it will terminate the program with a non-zero status. Both of those seems like good normal things. Instead, just throw e.getTargetException
? (I suppose it would be even better to handle the case of a null
target, but that is not supposed to happen in normal use.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any ideas on how to handle null ? I'm thinking of comparing to null.asInstanceOf[Throwable]
What do you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about:
case e: InvocationTargetException => e.getCause match {
case cause: Throwable => throw cause
case null => throw e
}
(getCause
is a little more standard)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better 👍
Merged build finished. All automated tests passed. |
All automated tests passed. |
Merged build triggered. |
Merged build started. |
Merged build finished. All automated tests passed. |
All automated tests passed. |
LGTM - I built and tested this locally and it worked well:
|
I've merged this - thanks! |
…argetException" Catching the InvocationTargetException, printing getTargetException. Author: Sandeep <[email protected]> Closes #630 from techaddict/SPARK-1710 and squashes the following commits: 834d79b [Sandeep] changes from srowen suggestions 109d604 [Sandeep] SPARK-1710: spark-submit should print better errors than "InvocationTargetException" (cherry picked from commit b48a55a) Signed-off-by: Patrick Wendell <[email protected]>
…argetException" Catching the InvocationTargetException, printing getTargetException. Author: Sandeep <[email protected]> Closes apache#630 from techaddict/SPARK-1710 and squashes the following commits: 834d79b [Sandeep] changes from srowen suggestions 109d604 [Sandeep] SPARK-1710: spark-submit should print better errors than "InvocationTargetException"
…che#630) * Try using runtimeElements * Add tests * Use path instead of name parameter * Add newline Co-authored-by: Willi Raschkowski <[email protected]>
Iceberg 0.13.0.3 - ADT 1.1.7 2022-05-20 PRs Merged * Internal: Parquet bloom filter support (apache#594 (https://github.pie.apple.com/IPR/apache-incubator-iceberg/pull/594)) * Internal: AWS Kms Client (apache#630 (https://github.pie.apple.com/IPR/apache-incubator-iceberg/pull/630)) * Internal: Core: Add client-side check of encryption properties (apache#626 (https://github.pie.apple.com/IPR/apache-incubator-iceberg/pull/626)) * Core: Align snapshot summary property names for delete files (apache#4766 (apache/iceberg#4766)) * Core: Add eq and pos delete file counts to snapshot summary (apache#4677 (apache/iceberg#4677)) * Spark 3.2: Clean static vars in SparkTableUtil (apache#4765 (apache/iceberg#4765)) * Spark 3.2: Avoid reflection to load metadata tables in SparkTableUtil (apache#4758 (apache/iceberg#4758)) * Core: Fix query failure when using projection on top of partitions metadata table (apache#4720) (apache#619 (https://github.pie.apple.com/IPR/apache-incubator-iceberg/pull/619)) Key Notes Bloom filter support and Client Side Encryption Features can be used in this release. Both features are only enabled with explicit flags and will not effect existing tables or jobs.
Catching the InvocationTargetException, printing getTargetException.