You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lens.apache.org by Sushil Mohanty <su...@gmail.com> on 2015/02/23 07:37:39 UTC

Review Request 31294: LENS:332 - Use prepare statement for query syntax and semantic validation

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

Review request for lens, Amareshwari Sriramadasu, Jaideep dhok, and Srikanth Sundarrajan.


Bugs: LENS-332
    https://issues.apache.org/jira/browse/LENS-332


Repository: lens


Description
-------

Earlier we were using rough query for syntactic and semantic correctness of query. Rough query can take more time based on the query complexity and can't guarantee to finish <50ms. Server side prepare statement is very light weight and can finish much faster.


Diffs
-----

  lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java 15ca19a 
  lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriverConfConstants.java 1c04b65 
  lens-driver-jdbc/src/test/java/org/apache/lens/driver/jdbc/TestJdbcDriver.java a5843ba 

Diff: https://reviews.apache.org/r/31294/diff/


Testing
-------

Added test to validate the query. All unit tests are running fine.
INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Lens Checkstyle Rules ............................. SUCCESS [4.158s]
[INFO] Lens .............................................. SUCCESS [0.198s]
[INFO] Lens API .......................................... SUCCESS [12.111s]
[INFO] Lens API for server and extensions ................ SUCCESS [7.694s]
[INFO] Lens Cube ......................................... SUCCESS [9:10.223s]
[INFO] Lens DB storage ................................... SUCCESS [25.488s]
[INFO] Lens Query Library ................................ SUCCESS [8.220s]
[INFO] Lens Hive Driver .................................. SUCCESS [3:39.119s]
[INFO] Lens Driver for JDBC .............................. SUCCESS [35.204s]
[INFO] Lens Server ....................................... SUCCESS [11:16.339s]
[INFO] Lens client ....................................... SUCCESS [37.933s]
[INFO] Lens CLI .......................................... SUCCESS [2:36.582s]
[INFO] Lens Examples ..................................... SUCCESS [0.858s]
[INFO] Lens Distribution ................................. SUCCESS [0.930s]
[INFO] Lens ML Lib ....................................... SUCCESS [1:17.754s]
[INFO] Lens Regression ................................... SUCCESS [0.111s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------


Thanks,

Sushil Mohanty


Re: Review Request 31294: LENS:332 - Use prepare statement for query syntax and semantic validation

Posted by Sushil Mohanty <su...@gmail.com>.

> On Feb. 23, 2015, 7:24 a.m., Amareshwari Sriramadasu wrote:
> > lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java, line 651
> > <https://reviews.apache.org/r/31294/diff/1/?file=872559#file872559line651>
> >
> >     Are the error messages same as earlier? Dont we have to change any tests?

Server side prepare statement throws SQLWarning. For eg.
1. java.sql.SQLWarning: Unknown column 'xxxxxxxx' in 'field list'
2. java.sql.SQLWarning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROMM xxxxxxxxx' at line 1

Added testcase for failure case of prepared statement.


- Sushil


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


On Feb. 23, 2015, 6:37 a.m., Sushil Mohanty wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31294/
> -----------------------------------------------------------
> 
> (Updated Feb. 23, 2015, 6:37 a.m.)
> 
> 
> Review request for lens, Amareshwari Sriramadasu, Jaideep dhok, and Srikanth Sundarrajan.
> 
> 
> Bugs: LENS-332
>     https://issues.apache.org/jira/browse/LENS-332
> 
> 
> Repository: lens
> 
> 
> Description
> -------
> 
> Earlier we were using rough query for syntactic and semantic correctness of query. Rough query can take more time based on the query complexity and can't guarantee to finish <50ms. Server side prepare statement is very light weight and can finish much faster.
> 
> 
> Diffs
> -----
> 
>   lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java 15ca19a 
>   lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriverConfConstants.java 1c04b65 
>   lens-driver-jdbc/src/test/java/org/apache/lens/driver/jdbc/TestJdbcDriver.java a5843ba 
> 
> Diff: https://reviews.apache.org/r/31294/diff/
> 
> 
> Testing
> -------
> 
> Added test to validate the query. All unit tests are running fine.
> INFO] ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] Lens Checkstyle Rules ............................. SUCCESS [4.158s]
> [INFO] Lens .............................................. SUCCESS [0.198s]
> [INFO] Lens API .......................................... SUCCESS [12.111s]
> [INFO] Lens API for server and extensions ................ SUCCESS [7.694s]
> [INFO] Lens Cube ......................................... SUCCESS [9:10.223s]
> [INFO] Lens DB storage ................................... SUCCESS [25.488s]
> [INFO] Lens Query Library ................................ SUCCESS [8.220s]
> [INFO] Lens Hive Driver .................................. SUCCESS [3:39.119s]
> [INFO] Lens Driver for JDBC .............................. SUCCESS [35.204s]
> [INFO] Lens Server ....................................... SUCCESS [11:16.339s]
> [INFO] Lens client ....................................... SUCCESS [37.933s]
> [INFO] Lens CLI .......................................... SUCCESS [2:36.582s]
> [INFO] Lens Examples ..................................... SUCCESS [0.858s]
> [INFO] Lens Distribution ................................. SUCCESS [0.930s]
> [INFO] Lens ML Lib ....................................... SUCCESS [1:17.754s]
> [INFO] Lens Regression ................................... SUCCESS [0.111s]
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Sushil Mohanty
> 
>


Re: Review Request 31294: LENS:332 - Use prepare statement for query syntax and semantic validation

Posted by Amareshwari Sriramadasu <am...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31294/#review73526
-----------------------------------------------------------



lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java
<https://reviews.apache.org/r/31294/#comment119921>

    unused code. Please remove



lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java
<https://reviews.apache.org/r/31294/#comment119924>

    Are the error messages same as earlier? Dont we have to change any tests?



lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java
<https://reviews.apache.org/r/31294/#comment119925>

    Please fix indentation


- Amareshwari Sriramadasu


On Feb. 23, 2015, 6:37 a.m., Sushil Mohanty wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31294/
> -----------------------------------------------------------
> 
> (Updated Feb. 23, 2015, 6:37 a.m.)
> 
> 
> Review request for lens, Amareshwari Sriramadasu, Jaideep dhok, and Srikanth Sundarrajan.
> 
> 
> Bugs: LENS-332
>     https://issues.apache.org/jira/browse/LENS-332
> 
> 
> Repository: lens
> 
> 
> Description
> -------
> 
> Earlier we were using rough query for syntactic and semantic correctness of query. Rough query can take more time based on the query complexity and can't guarantee to finish <50ms. Server side prepare statement is very light weight and can finish much faster.
> 
> 
> Diffs
> -----
> 
>   lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java 15ca19a 
>   lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriverConfConstants.java 1c04b65 
>   lens-driver-jdbc/src/test/java/org/apache/lens/driver/jdbc/TestJdbcDriver.java a5843ba 
> 
> Diff: https://reviews.apache.org/r/31294/diff/
> 
> 
> Testing
> -------
> 
> Added test to validate the query. All unit tests are running fine.
> INFO] ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] Lens Checkstyle Rules ............................. SUCCESS [4.158s]
> [INFO] Lens .............................................. SUCCESS [0.198s]
> [INFO] Lens API .......................................... SUCCESS [12.111s]
> [INFO] Lens API for server and extensions ................ SUCCESS [7.694s]
> [INFO] Lens Cube ......................................... SUCCESS [9:10.223s]
> [INFO] Lens DB storage ................................... SUCCESS [25.488s]
> [INFO] Lens Query Library ................................ SUCCESS [8.220s]
> [INFO] Lens Hive Driver .................................. SUCCESS [3:39.119s]
> [INFO] Lens Driver for JDBC .............................. SUCCESS [35.204s]
> [INFO] Lens Server ....................................... SUCCESS [11:16.339s]
> [INFO] Lens client ....................................... SUCCESS [37.933s]
> [INFO] Lens CLI .......................................... SUCCESS [2:36.582s]
> [INFO] Lens Examples ..................................... SUCCESS [0.858s]
> [INFO] Lens Distribution ................................. SUCCESS [0.930s]
> [INFO] Lens ML Lib ....................................... SUCCESS [1:17.754s]
> [INFO] Lens Regression ................................... SUCCESS [0.111s]
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Sushil Mohanty
> 
>


Re: Review Request 31294: LENS:332 - Use prepare statement for query syntax and semantic validation

Posted by Amareshwari Sriramadasu <am...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31294/#review73541
-----------------------------------------------------------



lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java
<https://reviews.apache.org/r/31294/#comment119951>

    estimate should not call explain any more. return cost directly.



lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriverConfConstants.java
<https://reviews.apache.org/r/31294/#comment119950>

    Please add the new config in jdbcdriver-default.xml with description and include generated apt file.


- Amareshwari Sriramadasu


On Feb. 23, 2015, 9:35 a.m., Sushil Mohanty wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31294/
> -----------------------------------------------------------
> 
> (Updated Feb. 23, 2015, 9:35 a.m.)
> 
> 
> Review request for lens, Amareshwari Sriramadasu, Jaideep dhok, and Srikanth Sundarrajan.
> 
> 
> Bugs: LENS-332
>     https://issues.apache.org/jira/browse/LENS-332
> 
> 
> Repository: lens
> 
> 
> Description
> -------
> 
> Earlier we were using rough query for syntactic and semantic correctness of query. Rough query can take more time based on the query complexity and can't guarantee to finish <50ms. Server side prepare statement is very light weight and can finish much faster.
> 
> 
> Diffs
> -----
> 
>   lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java 15ca19a 
>   lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriverConfConstants.java 1c04b65 
>   lens-driver-jdbc/src/test/java/org/apache/lens/driver/jdbc/TestJdbcDriver.java a5843ba 
> 
> Diff: https://reviews.apache.org/r/31294/diff/
> 
> 
> Testing
> -------
> 
> Added test to validate the query. All unit tests are running fine.
> INFO] ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] Lens Checkstyle Rules ............................. SUCCESS [4.158s]
> [INFO] Lens .............................................. SUCCESS [0.198s]
> [INFO] Lens API .......................................... SUCCESS [12.111s]
> [INFO] Lens API for server and extensions ................ SUCCESS [7.694s]
> [INFO] Lens Cube ......................................... SUCCESS [9:10.223s]
> [INFO] Lens DB storage ................................... SUCCESS [25.488s]
> [INFO] Lens Query Library ................................ SUCCESS [8.220s]
> [INFO] Lens Hive Driver .................................. SUCCESS [3:39.119s]
> [INFO] Lens Driver for JDBC .............................. SUCCESS [35.204s]
> [INFO] Lens Server ....................................... SUCCESS [11:16.339s]
> [INFO] Lens client ....................................... SUCCESS [37.933s]
> [INFO] Lens CLI .......................................... SUCCESS [2:36.582s]
> [INFO] Lens Examples ..................................... SUCCESS [0.858s]
> [INFO] Lens Distribution ................................. SUCCESS [0.930s]
> [INFO] Lens ML Lib ....................................... SUCCESS [1:17.754s]
> [INFO] Lens Regression ................................... SUCCESS [0.111s]
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Sushil Mohanty
> 
>


Re: Review Request 31294: LENS:332 - Use prepare statement for query syntax and semantic validation

Posted by Amareshwari Sriramadasu <am...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31294/#review73761
-----------------------------------------------------------

Ship it!


Ship It!

- Amareshwari Sriramadasu


On Feb. 23, 2015, 4:44 p.m., Sushil Mohanty wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31294/
> -----------------------------------------------------------
> 
> (Updated Feb. 23, 2015, 4:44 p.m.)
> 
> 
> Review request for lens, Amareshwari Sriramadasu, Jaideep dhok, and Srikanth Sundarrajan.
> 
> 
> Bugs: LENS-332
>     https://issues.apache.org/jira/browse/LENS-332
> 
> 
> Repository: lens
> 
> 
> Description
> -------
> 
> Earlier we were using rough query for syntactic and semantic correctness of query. Rough query can take more time based on the query complexity and can't guarantee to finish <50ms. Server side prepare statement is very light weight and can finish much faster.
> 
> 
> Diffs
> -----
> 
>   lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java 15ca19a 
>   lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriverConfConstants.java 1c04b65 
>   lens-driver-jdbc/src/main/resources/jdbcdriver-default.xml c715a0e 
>   lens-driver-jdbc/src/test/java/org/apache/lens/driver/jdbc/TestJdbcDriver.java a5843ba 
>   src/site/apt/admin/jdbcdriver-config.apt 126567a 
> 
> Diff: https://reviews.apache.org/r/31294/diff/
> 
> 
> Testing
> -------
> 
> Added test to validate the query. All unit tests are running fine.
> INFO] ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] Lens Checkstyle Rules ............................. SUCCESS [4.158s]
> [INFO] Lens .............................................. SUCCESS [0.198s]
> [INFO] Lens API .......................................... SUCCESS [12.111s]
> [INFO] Lens API for server and extensions ................ SUCCESS [7.694s]
> [INFO] Lens Cube ......................................... SUCCESS [9:10.223s]
> [INFO] Lens DB storage ................................... SUCCESS [25.488s]
> [INFO] Lens Query Library ................................ SUCCESS [8.220s]
> [INFO] Lens Hive Driver .................................. SUCCESS [3:39.119s]
> [INFO] Lens Driver for JDBC .............................. SUCCESS [35.204s]
> [INFO] Lens Server ....................................... SUCCESS [11:16.339s]
> [INFO] Lens client ....................................... SUCCESS [37.933s]
> [INFO] Lens CLI .......................................... SUCCESS [2:36.582s]
> [INFO] Lens Examples ..................................... SUCCESS [0.858s]
> [INFO] Lens Distribution ................................. SUCCESS [0.930s]
> [INFO] Lens ML Lib ....................................... SUCCESS [1:17.754s]
> [INFO] Lens Regression ................................... SUCCESS [0.111s]
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Sushil Mohanty
> 
>


Re: Review Request 31294: LENS:332 - Use prepare statement for query syntax and semantic validation

Posted by Sushil Mohanty <su...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31294/
-----------------------------------------------------------

(Updated Feb. 23, 2015, 4:44 p.m.)


Review request for lens, Amareshwari Sriramadasu, Jaideep dhok, and Srikanth Sundarrajan.


Changes
-------

Addressed review comments.


Bugs: LENS-332
    https://issues.apache.org/jira/browse/LENS-332


Repository: lens


Description
-------

Earlier we were using rough query for syntactic and semantic correctness of query. Rough query can take more time based on the query complexity and can't guarantee to finish <50ms. Server side prepare statement is very light weight and can finish much faster.


Diffs (updated)
-----

  lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java 15ca19a 
  lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriverConfConstants.java 1c04b65 
  lens-driver-jdbc/src/main/resources/jdbcdriver-default.xml c715a0e 
  lens-driver-jdbc/src/test/java/org/apache/lens/driver/jdbc/TestJdbcDriver.java a5843ba 
  src/site/apt/admin/jdbcdriver-config.apt 126567a 

Diff: https://reviews.apache.org/r/31294/diff/


Testing
-------

Added test to validate the query. All unit tests are running fine.
INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Lens Checkstyle Rules ............................. SUCCESS [4.158s]
[INFO] Lens .............................................. SUCCESS [0.198s]
[INFO] Lens API .......................................... SUCCESS [12.111s]
[INFO] Lens API for server and extensions ................ SUCCESS [7.694s]
[INFO] Lens Cube ......................................... SUCCESS [9:10.223s]
[INFO] Lens DB storage ................................... SUCCESS [25.488s]
[INFO] Lens Query Library ................................ SUCCESS [8.220s]
[INFO] Lens Hive Driver .................................. SUCCESS [3:39.119s]
[INFO] Lens Driver for JDBC .............................. SUCCESS [35.204s]
[INFO] Lens Server ....................................... SUCCESS [11:16.339s]
[INFO] Lens client ....................................... SUCCESS [37.933s]
[INFO] Lens CLI .......................................... SUCCESS [2:36.582s]
[INFO] Lens Examples ..................................... SUCCESS [0.858s]
[INFO] Lens Distribution ................................. SUCCESS [0.930s]
[INFO] Lens ML Lib ....................................... SUCCESS [1:17.754s]
[INFO] Lens Regression ................................... SUCCESS [0.111s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------


Thanks,

Sushil Mohanty


Re: Review Request 31294: LENS:332 - Use prepare statement for query syntax and semantic validation

Posted by Sushil Mohanty <su...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31294/
-----------------------------------------------------------

(Updated Feb. 23, 2015, 9:35 a.m.)


Review request for lens, Amareshwari Sriramadasu, Jaideep dhok, and Srikanth Sundarrajan.


Changes
-------

Added testcase for failed prepared statement and addressed other review comments.


Bugs: LENS-332
    https://issues.apache.org/jira/browse/LENS-332


Repository: lens


Description
-------

Earlier we were using rough query for syntactic and semantic correctness of query. Rough query can take more time based on the query complexity and can't guarantee to finish <50ms. Server side prepare statement is very light weight and can finish much faster.


Diffs (updated)
-----

  lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java 15ca19a 
  lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriverConfConstants.java 1c04b65 
  lens-driver-jdbc/src/test/java/org/apache/lens/driver/jdbc/TestJdbcDriver.java a5843ba 

Diff: https://reviews.apache.org/r/31294/diff/


Testing
-------

Added test to validate the query. All unit tests are running fine.
INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Lens Checkstyle Rules ............................. SUCCESS [4.158s]
[INFO] Lens .............................................. SUCCESS [0.198s]
[INFO] Lens API .......................................... SUCCESS [12.111s]
[INFO] Lens API for server and extensions ................ SUCCESS [7.694s]
[INFO] Lens Cube ......................................... SUCCESS [9:10.223s]
[INFO] Lens DB storage ................................... SUCCESS [25.488s]
[INFO] Lens Query Library ................................ SUCCESS [8.220s]
[INFO] Lens Hive Driver .................................. SUCCESS [3:39.119s]
[INFO] Lens Driver for JDBC .............................. SUCCESS [35.204s]
[INFO] Lens Server ....................................... SUCCESS [11:16.339s]
[INFO] Lens client ....................................... SUCCESS [37.933s]
[INFO] Lens CLI .......................................... SUCCESS [2:36.582s]
[INFO] Lens Examples ..................................... SUCCESS [0.858s]
[INFO] Lens Distribution ................................. SUCCESS [0.930s]
[INFO] Lens ML Lib ....................................... SUCCESS [1:17.754s]
[INFO] Lens Regression ................................... SUCCESS [0.111s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------


Thanks,

Sushil Mohanty