> On Oct. 9, 2015, 2:49 a.m., Puneet Gupta wrote:
> > lens-driver-hive/src/main/java/org/apache/lens/driver/hive/HiveDriver.java,
> > line 522
> > <https://reviews.apache.org/r/39131/diff/1/?file=1093125#file1093125line522>
> >
> > just a query .
> > Can there be a better way to find this? Relying on message contains is
> > not very reliable.
> >
> > is it possible to add a test case?
Hey Puneet,
Let me look at the test case part. Also, I agree this is not the cleanest way
to identify SemanticException but this is the only way I could identify a
SemanticException from HiveSQLException object. This is how the exception looks
like -
org.apache.hive.service.cli.HiveSQLException: Error while compiling
statement: FAILED: SemanticException [Error 10001]: Line 1:31 Table not found
'test_data44'
at
org.apache.hive.service.cli.thrift.ThriftCLIServiceClient.checkStatus(ThriftCLIServiceClient.java:52)
~[hive-service-0.13.3-inm.jar:0.13.3-inm]
at
org.apache.hive.service.cli.thrift.ThriftCLIServiceClient.executeStatementInternal(ThriftCLIServiceClient.java:151)
~[hive-service-0.13.3-inm.jar:0.13.3-inm]
at
org.apache.hive.service.cli.thrift.ThriftCLIServiceClient.executeStatement(ThriftCLIServiceClient.java:129)
~[hive-service-0.13.3-inm.jar:0.13.3-inm]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
~[na:1.7.0_75]
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
~[na:1.7.0_75]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.7.0_75]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_75]
at
org.apache.hive.service.cli.thrift.RetryingThriftCLIServiceClient.invokeInternal(RetryingThriftCLIServiceClient.java:301)
~[hive-service-0.13.3-inm.jar:0.13.3-inm]
at
org.apache.hive.service.cli.thrift.RetryingThriftCLIServiceClient.invoke(RetryingThriftCLIServiceClient.java:329)
~[hive-service-0.13.3-inm.jar:0.13.3-inm]
at com.sun.proxy.$Proxy58.executeStatement(Unknown Source) ~[na:na]
at
org.apache.hive.service.cli.thrift.RetryingThriftCLIServiceClient$CLIServiceClientWrapper.executeStatement(RetryingThriftCLIServiceClient.java:111)
~[hive-service-0.13.3-inm.jar:0.13.3-inm]
at org.apache.lens.driver.hive.HiveDriver.execute(HiveDriver.java:494)
~[lens-driver-hive-2.4.0-beta-SNAPSHOT.jar:2.4.0-beta-SNAPSHOT]
- Deepak
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39131/#review102001
-----------------------------------------------------------
On Oct. 8, 2015, 1:45 p.m., Deepak Barr wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39131/
> -----------------------------------------------------------
>
> (Updated Oct. 8, 2015, 1:45 p.m.)
>
>
> Review request for lens.
>
>
> Repository: lens
>
>
> Description
> -------
>
> Added a Hive Error code for handling semantic exceptions
>
>
> Earlier, if someone queries a native table that 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
> .
> .
> .
>
> -----------------------------------------------
>
> After the fix-
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <lensAPIResult>
> <id>81753012-99e8-4695-ac60-33ee1e9db289</id>
> <error>
> <code>4001</code>
> <message>Semantic Error : Error while compiling statement: FAILED:
> SemanticException [Error 10001]: Line 1:31 Table not found
> 'test_data44'</message>
> <stackTrace>org.apache.lens.server.api.error.LensException:
> SEMANTIC_ERROR[Error while compiling statement: FAILED: SemanticException
> [Error 10001]: Line 1:31 Table not found 'test_data44']
> .
> .
> .
>
>
> Diffs
> -----
>
> lens-api/src/main/resources/lens-errors.conf a582dc2
> lens-driver-hive/src/main/java/org/apache/lens/driver/hive/HiveDriver.java
> 4561ccf
>
> lens-driver-hive/src/main/java/org/apache/lens/driver/hive/LensHiveErrorCode.java
> PRE-CREATION
>
> Diff: https://reviews.apache.org/r/39131/diff/
>
>
> Testing
> -------
>
> Yes.
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] Lens Checkstyle Rules .............................. SUCCESS [ 2.394
> s]
> [INFO] Lens ............................................... SUCCESS [ 4.437
> s]
> [INFO] Lens API ........................................... SUCCESS [ 29.879
> s]
> [INFO] Lens API for server and extensions ................. SUCCESS [ 26.698
> s]
> [INFO] Lens Cube .......................................... SUCCESS [07:06
> min]
> [INFO] Lens DB storage .................................... SUCCESS [ 26.526
> s]
> [INFO] Lens Query Library ................................. SUCCESS [ 21.488
> s]
> [INFO] Lens Hive Driver ................................... SUCCESS [04:14
> min]
> [INFO] Lens Driver for JDBC ............................... SUCCESS [ 54.033
> s]
> [INFO] Lens Elastic Search Driver ......................... SUCCESS [ 21.722
> s]
> [INFO] Lens Server ........................................ SUCCESS [11:19
> min]
> [INFO] Lens client ........................................ SUCCESS [ 46.726
> s]
> [INFO] Lens CLI ........................................... SUCCESS [03:45
> min]
> [INFO] Lens Examples ...................................... SUCCESS [ 11.543
> s]
> [INFO] Lens Distribution .................................. SUCCESS [ 12.677
> s]
> [INFO] Lens ML Lib ........................................ SUCCESS [02:05
> min]
> [INFO] Lens ML Ext Distribution ........................... SUCCESS [ 2.966
> s]
> [INFO] Lens Regression .................................... SUCCESS [ 16.229
> s]
> [INFO] Lens UI ............................................ SUCCESS [ 42.657
> s]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 33:51 min
> [INFO] Finished at: 2015-10-06T23:01:26+05:30
> [INFO] Final Memory: 216M/3028M
> [INFO]
> ------------------------------------------------------------------------
>
>
> Thanks,
>
> Deepak Barr
>
>