-
Notifications
You must be signed in to change notification settings - Fork 28.7k
[SPARK-4935][SQL] When hive.cli.print.header configured, spark-sql aborted if passed in a invalid sql #3761
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
Conversation
Test build #24701 has started for PR 3761 at commit
|
Test build #24703 has started for PR 3761 at commit
|
Test build #24701 has finished for PR 3761 at commit
|
Test PASSed. |
Test build #24703 has finished for PR 3761 at commit
|
Test PASSed. |
Hm, just tried |
Hi @liancheng, this is a very interesting bug i think, if you place a hive-site.xml into spark/conf, this will happen. |
If we config
spark-sql will abort. |
This is because sparksqldriver always return ResponseCode(0), even if we pass a invalid sql. So
will be never executed.
it will throw NPE when passed in a invalid sql |
@scwf Thanks for the explanation! Then this change makes sense and LGTM. |
@@ -278,7 +278,6 @@ private[hive] class SparkSQLCLIDriver extends CliDriver with Logging { | |||
|
|||
ret = rc.getResponseCode | |||
if (ret != 0) { | |||
console.printError(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.
Wait, I don't think we should remove this line, although this may cause duplicated error reporting in this specific case, removing this may silent other error messages.
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.
Actually before this PR this line do not executed, seems it does not matter, can you explain why it will silent some error messages.
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.
This line is not triggered because we didn't assign non-zero return code properly before. But now we're using proper return code. Although exceptions and error messages are also caught and reported in other places (e.g. within HiveContext), I still tend to keep this line.
Test build #24754 has started for PR 3761 at commit
|
Test build #24754 has finished for PR 3761 at commit
|
Test PASSed. |
Updated. |
Thanks! Merged to master. |
If we passed in a wrong sql like
abdcdfsfs
, the spark-sql script aborted.