[
https://issues.apache.org/jira/browse/HIVE-795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12747569#action_12747569
]
Bill Graham commented on HIVE-795:
----------------------------------
To get better error messages from the Hive server, refactoring of the
{{Driver}} class is needed to propagate the message. I propose the following
changes:
- Refactor {{Driver}} with a new method like
{{public DriverResponse runCommand(String command)}}.
It does the same thing as the current
{{public int run(String command)}}
method, but instead returns a composite object which contains a
{{responseCode}} and {{errorMessage}}. This method would be the favored one to
use going forward, {{run}} is just kept for backward compatibility and possibly
deprecated.
- Refactor {{HiveServer.execute(cmd)}} to use {{Driver.runCommand(cmd)}}. It
will throw a {{HiveServerException}} with {{responseCode}} and {{errorMessage}}
info.
- Add a {{responseCode}} field to {{HiveServerException}}.
{{HiveServer.execute(cmd)}} will set the {{message}} and {{responseCode}}
fields when throwing a new {{HiveServerException}}, instead of a string message
containing the response code.
- The JDBC client can catch {{HiveServerException}} in
{{HiveStatement.executQuery(sql)}} and create a meaningful {{SQLException}}.
> Return better error messaging from HiveServer
> ----------------------------------------------
>
> Key: HIVE-795
> URL: https://issues.apache.org/jira/browse/HIVE-795
> Project: Hadoop Hive
> Issue Type: Improvement
> Reporter: Bill Graham
> Assignee: Bill Graham
>
> If an exception is thrown on the Hive server (i.e., when an invalid query is
> passed), the Hive server throws a HiveServerExcpeption to the client with a
> message like "Query returned non-zero code: 10". A more informative
> description of the cause of the error should be returned.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.