-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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-40180][SQL] Format error messages by spark-sql
#37590
Conversation
spark-sql
spark-sql
spark-sql
spark-sql
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.
Very nice!
// to the console. | ||
case _ => err.println(s"""Error in query: ${e.getMessage}""") | ||
} | ||
case _ => err.println(rc.getErrorMessage()) |
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.
even before this PR, we may not print Error in query:
either. I think it's fine to clean it up and get rid of this prefix
Merging to master. Thank you, @srielau @yaooqinn @cloud-fan for review. |
What changes were proposed in this pull request?
spark.sql.error.messageFormat
introduced by [SPARK-40098][SQL] Format error messages in the Thrift Server #37520, and output error messages in the one of format:PRETTY
(by default),MINIMAL
orSTANDARD
.PRETTY
format, output the error message of theAnalysisException
exception in the same way as for other exceptions, i. e. w/oError in query:
.silent
CLI option, and output the call stack only when it isfalse
.In the
MINIMAL
andSTANDARD
formats don't print the call stack independently from thesilent
mode.Why are the changes needed?
To respect the SQL config
spark.sql.error.messageFormat
and to be consistent to error outputs of the Thrift Server.Does this PR introduce any user-facing change?
Yes.
The PR changes the behavior for
AnalysisException
. In that case,spark-sql
does not output the prefix:Error in query:
by default (format is PRETTY).Before:
After:
How was this patch tested?
By running the modified test suites: