You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lens.apache.org by Deepak Barr <de...@gmail.com> on 2015/12/14 16:06:52 UTC

Re: Review Request 39131: LENS -750 : Handle SemanticException from HiveDriver instead of throwing 500 Internal Server Error


> On Oct. 9, 2015, 12:27 p.m., Amareshwari Sriramadasu wrote:
> > lens-driver-hive/src/main/java/org/apache/lens/driver/hive/HiveDriver.java, line 517
> > <https://reviews.apache.org/r/39131/diff/1/?file=1093125#file1093125line517>
> >
> >     Can you do the same changes for explain, estimate, executeAsync?
> >     
> >     Shall we have handleHiveSQLException method throws proper LensException?

Hey amareshwari,

   Not sure if that would be necessary. explain and estimate methods call execute() method. Also, when running an async query, explain() is called first before executeAsync(). So the error will be captured when submitting the query itself. So, it should suffice to handle for execute() method. What do you think ?


- Deepak


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39131/#review102050
-----------------------------------------------------------


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
> 
>