You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lens.apache.org by "Amareshwari Sriramadasu (JIRA)" <ji...@apache.org> on 2015/08/31 06:42:45 UTC

[jira] [Commented] (LENS-750) Add Hive error codes for Semantic and Authorization exceptions

    [ https://issues.apache.org/jira/browse/LENS-750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14722696#comment-14722696 ] 

Amareshwari Sriramadasu commented on LENS-750:
----------------------------------------------

Here are few hive errors I could think of we might encounter :
- Semantic Exception  : Can be mapped to Bad request (400) with error corresponding to semantic exception.
- Hive Exception : Metastore server or HiveServer is not accessible : Can be mapped to Hive Error (500) with error message corresponding to the exception.
- Other : would be still 500 (internal server error) until categorized.

Does the above look good?

> Add Hive error codes for Semantic and Authorization exceptions
> --------------------------------------------------------------
>
>                 Key: LENS-750
>                 URL: https://issues.apache.org/jira/browse/LENS-750
>             Project: Apache Lens
>          Issue Type: Improvement
>          Components: api, driver-hive, server
>            Reporter: Deepak Barr
>            Assignee: Deepak Barr
>             Fix For: 2.4
>
>
> When a query fails on hive server because of a semantic exception (say table or column does not exist), The submit query [/lensapi/queries] API returns 500 internal server error along with a stack trace. 
> It would be good to define some hive error codes to cover hive semantic exceptions and authorization exceptions. Relevant error messages will enable user to fix their queries.
> Here is sample response on submitted query when table does not exist -
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <lensAPIResult>
>     <id>d482699c-f3cd-49d7-a8a5-dd8437ec4ee3</id>
>     <error>
>         <code>1001</code>
>         <message>Internal Server Error.</message>
>         <stackTrace>org.apache.lens.server.api.error.LensException: Error executing query
> 	at org.apache.lens.driver.hive.HiveDriver.execute(HiveDriver.java:516)
> 	at org.apache.lens.driver.hive.HiveDriver.explain(HiveDriver.java:426)
> 	at org.apache.lens.driver.hive.HiveDriver.estimate(HiveDriver.java:397)
> 	at org.apache.lens.server.api.query.AbstractQueryContext$DriverEstimateRunnable.run(AbstractQueryContext.java:243)
> 	at org.apache.lens.server.query.QueryExecutionServiceImpl$RewriteEstimateRunnable.run(QueryExecutionServiceImpl.java:1359)
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> 	at java.lang.Thread.run(Thread.java:745)
> Caused by: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: SemanticException Line 0:-1 Table not found 'test_data2'
> 	at org.apache.hive.service.cli.thrift.ThriftCLIServiceClient.checkStatus(ThriftCLIServiceClient.java:52)
> 	at org.apache.hive.service.cli.thrift.ThriftCLIServiceClient.executeStatementInternal(ThriftCLIServiceClient.java:151)
> 	at org.apache.hive.service.cli.thrift.ThriftCLIServiceClient.executeStatement(ThriftCLIServiceClient.java:129)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:606)
> 	at org.apache.hive.service.cli.thrift.RetryingThriftCLIServiceClient.invokeInternal(RetryingThriftCLIServiceClient.java:301)
> 	at org.apache.hive.service.cli.thrift.RetryingThriftCLIServiceClient.invoke(RetryingThriftCLIServiceClient.java:329)
> 	at com.sun.proxy.$Proxy57.executeStatement(Unknown Source)
> 	at org.apache.hive.service.cli.thrift.RetryingThriftCLIServiceClient$CLIServiceClientWrapper.executeStatement(RetryingThriftCLIServiceClient.java:111)
> 	at org.apache.lens.driver.hive.HiveDriver.execute(HiveDriver.java:493)
> 	... 9 more
> </stackTrace>
>     </error>
> </lensAPIResult>
> Proposed response 
> ----------------------------
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <lensAPIResult>
>     <id>d01a0633-f02b-4461-aa54-fc189b625001</id>
>     <error>
>         <code>4001</code>
>         <message>Semantic Error : Error while compiling statement: FAILED: SemanticException Line 0:-1 Table not found 'test_data2'</message>
>         <stackTrace>org.apache.lens.server.api.error.LensException
> 	at org.apache.lens.driver.hive.HiveDriver.createLensException(HiveDriver.java:595)
> 	at org.apache.lens.driver.hive.HiveDriver.execute(HiveDriver.java:589)
> 	at org.apache.lens.driver.hive.HiveDriver.explain(HiveDriver.java:497)
> 	at org.apache.lens.driver.hive.HiveDriver.estimate(HiveDriver.java:468)
> 	at org.apache.lens.server.api.query.AbstractQueryContext$DriverEstimateRunnable.run(AbstractQueryContext.java:243)
> 	at org.apache.lens.server.query.QueryExecutionServiceImpl$RewriteEstimateRunnable.run(QueryExecutionServiceImpl.java:1359)
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> 	at java.lang.Thread.run(Thread.java:745)
> Caused by: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: SemanticException Line 0:-1 Table not found 'test_data2'
> 	at org.apache.hive.service.cli.thrift.ThriftCLIServiceClient.checkStatus(ThriftCLIServiceClient.java:52)
> 	at org.apache.hive.service.cli.thrift.ThriftCLIServiceClient.executeStatementInternal(ThriftCLIServiceClient.java:151)
> 	at org.apache.hive.service.cli.thrift.ThriftCLIServiceClient.executeStatement(ThriftCLIServiceClient.java:129)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:606)
> 	at org.apache.hive.service.cli.thrift.RetryingThriftCLIServiceClient.invokeInternal(RetryingThriftCLIServiceClient.java:301)
> 	at org.apache.hive.service.cli.thrift.RetryingThriftCLIServiceClient.invoke(RetryingThriftCLIServiceClient.java:329)
> 	at com.sun.proxy.$Proxy55.executeStatement(Unknown Source)
> 	at org.apache.hive.service.cli.thrift.RetryingThriftCLIServiceClient$CLIServiceClientWrapper.executeStatement(RetryingThriftCLIServiceClient.java:111)
> 	at org.apache.lens.driver.hive.HiveDriver.execute(HiveDriver.java:566)
> 	... 9 more
> </stackTrace>
>     </error>
> </lensAPIResult>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)