Hive
  1. Hive
  2. HIVE-5006

Re-factor HiveServer2 JDBC PreparedStatement to avoid duplicate code

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.11.0
    • Fix Version/s: 0.12.0
    • Component/s: HiveServer2, JDBC
    • Labels:
      None

      Description

      The JDBC PreparedStatement interface extends Statement interface. The Hive JDBC driver implementations of HivePreparedStatement interface is disjoint from the HiveStatement implementation. As a result there's some duplicate code in these two classes for executing query. Also patches like implicit close on re-execute etc. are not there for PreparedStatement.

      The HivePreparedStatement should extend the HiveStatement.

      1. HIVE-5006.3.patch
        17 kB
        Prasad Mujumdar
      2. HIVE-5006.1.patch
        18 kB
        Prasad Mujumdar

        Activity

        Ashutosh Chauhan made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Ashutosh Chauhan added a comment -

        This issue has been fixed and released as part of 0.12 release. If you find further issues, please create a new jira and link it to this one.

        Show
        Ashutosh Chauhan added a comment - This issue has been fixed and released as part of 0.12 release. If you find further issues, please create a new jira and link it to this one.
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Hive-trunk-hadoop1-ptest #122 (See https://builds.apache.org/job/Hive-trunk-hadoop1-ptest/122/)
        HIVE-5006: Re-factor HiveServer2 JDBC PreparedStatement to avoid duplicate code (Prasad Mujumdar via Gunther Hagleitner) (gunther: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1512506)

        • /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HivePreparedStatement.java
        • /hive/trunk/jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Hive-trunk-hadoop1-ptest #122 (See https://builds.apache.org/job/Hive-trunk-hadoop1-ptest/122/ ) HIVE-5006 : Re-factor HiveServer2 JDBC PreparedStatement to avoid duplicate code (Prasad Mujumdar via Gunther Hagleitner) (gunther: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1512506 ) /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HivePreparedStatement.java /hive/trunk/jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java
        Hide
        Hudson added a comment -

        FAILURE: Integrated in Hive-trunk-hadoop2-ptest #51 (See https://builds.apache.org/job/Hive-trunk-hadoop2-ptest/51/)
        HIVE-5006: Re-factor HiveServer2 JDBC PreparedStatement to avoid duplicate code (Prasad Mujumdar via Gunther Hagleitner) (gunther: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1512506)

        • /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HivePreparedStatement.java
        • /hive/trunk/jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java
        Show
        Hudson added a comment - FAILURE: Integrated in Hive-trunk-hadoop2-ptest #51 (See https://builds.apache.org/job/Hive-trunk-hadoop2-ptest/51/ ) HIVE-5006 : Re-factor HiveServer2 JDBC PreparedStatement to avoid duplicate code (Prasad Mujumdar via Gunther Hagleitner) (gunther: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1512506 ) /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HivePreparedStatement.java /hive/trunk/jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Hive-trunk-h0.21 #2258 (See https://builds.apache.org/job/Hive-trunk-h0.21/2258/)
        HIVE-5006: Re-factor HiveServer2 JDBC PreparedStatement to avoid duplicate code (Prasad Mujumdar via Gunther Hagleitner) (gunther: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1512506)

        • /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HivePreparedStatement.java
        • /hive/trunk/jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Hive-trunk-h0.21 #2258 (See https://builds.apache.org/job/Hive-trunk-h0.21/2258/ ) HIVE-5006 : Re-factor HiveServer2 JDBC PreparedStatement to avoid duplicate code (Prasad Mujumdar via Gunther Hagleitner) (gunther: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1512506 ) /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HivePreparedStatement.java /hive/trunk/jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java
        Hide
        Hudson added a comment -

        FAILURE: Integrated in Hive-trunk-hadoop2 #348 (See https://builds.apache.org/job/Hive-trunk-hadoop2/348/)
        HIVE-5006: Re-factor HiveServer2 JDBC PreparedStatement to avoid duplicate code (Prasad Mujumdar via Gunther Hagleitner) (gunther: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1512506)

        • /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HivePreparedStatement.java
        • /hive/trunk/jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java
        Show
        Hudson added a comment - FAILURE: Integrated in Hive-trunk-hadoop2 #348 (See https://builds.apache.org/job/Hive-trunk-hadoop2/348/ ) HIVE-5006 : Re-factor HiveServer2 JDBC PreparedStatement to avoid duplicate code (Prasad Mujumdar via Gunther Hagleitner) (gunther: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1512506 ) /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HivePreparedStatement.java /hive/trunk/jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java
        Gunther Hagleitner made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Gunther Hagleitner added a comment -

        Committed to trunk. Thanks Prasad!

        Show
        Gunther Hagleitner added a comment - Committed to trunk. Thanks Prasad!
        Hide
        Thejas M Nair added a comment -

        Looks good. +1

        Show
        Thejas M Nair added a comment - Looks good. +1
        Hide
        Hive QA added a comment -

        Overall: +1 all checks pass

        Here are the results of testing the latest attachment:
        https://issues.apache.org/jira/secure/attachment/12597047/HIVE-5006.3.patch

        SUCCESS: +1 2774 tests passed

        Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/362/testReport
        Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/362/console

        Messages:

        Executing org.apache.hive.ptest.execution.PrepPhase
        Executing org.apache.hive.ptest.execution.ExecutionPhase
        Executing org.apache.hive.ptest.execution.ReportingPhase
        

        This message is automatically generated.

        Show
        Hive QA added a comment - Overall : +1 all checks pass Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12597047/HIVE-5006.3.patch SUCCESS: +1 2774 tests passed Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/362/testReport Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/362/console Messages: Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase This message is automatically generated.
        Hide
        Gunther Hagleitner added a comment -

        Thanks Prasad Mujumdar. LGTM. Will commit when pre-commit tests pass.

        Show
        Gunther Hagleitner added a comment - Thanks Prasad Mujumdar . LGTM. Will commit when pre-commit tests pass.
        Prasad Mujumdar made changes -
        Attachment HIVE-5006.3.patch [ 12597047 ]
        Hide
        Prasad Mujumdar added a comment -

        Thejas M Nair and Gunther Hagleitner Thanks for the feedback.
        New patch updated per review feedback.

        Show
        Prasad Mujumdar added a comment - Thejas M Nair and Gunther Hagleitner Thanks for the feedback. New patch updated per review feedback.
        Hide
        Gunther Hagleitner added a comment -

        Lots of red in the code + green in the tests. Very nice. LGTM +1. Prasad Mujumdar can you take a look at Thejas M Nair's comments? Seems like they are minor - will commit after you make an assessment.

        Show
        Gunther Hagleitner added a comment - Lots of red in the code + green in the tests. Very nice. LGTM +1. Prasad Mujumdar can you take a look at Thejas M Nair 's comments? Seems like they are minor - will commit after you make an assessment.
        Hide
        Thejas M Nair added a comment -

        Thanks for the patch Prasad!
        The code change looks good to me. I have some minor comments about the test case in reviewboard.

        Show
        Thejas M Nair added a comment - Thanks for the patch Prasad! The code change looks good to me. I have some minor comments about the test case in reviewboard.
        Hide
        Hive QA added a comment -

        Overall: -1 at least one tests failed

        Here are the results of testing the latest attachment:
        https://issues.apache.org/jira/secure/attachment/12596294/HIVE-5006.1.patch

        ERROR: -1 due to 1 failed/errored test(s), 2764 tests executed
        Failed tests:

        org.apache.hcatalog.fileformats.TestOrcDynamicPartitioned.testHCatDynamicPartitionedTableMultipleTask
        

        Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/325/testReport
        Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/325/console

        Messages:

        Executing org.apache.hive.ptest.execution.PrepPhase
        Executing org.apache.hive.ptest.execution.ExecutionPhase
        Executing org.apache.hive.ptest.execution.ReportingPhase
        Tests failed with: TestsFailedException: 1 tests failed
        

        This message is automatically generated.

        Show
        Hive QA added a comment - Overall : -1 at least one tests failed Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12596294/HIVE-5006.1.patch ERROR: -1 due to 1 failed/errored test(s), 2764 tests executed Failed tests: org.apache.hcatalog.fileformats.TestOrcDynamicPartitioned.testHCatDynamicPartitionedTableMultipleTask Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/325/testReport Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/325/console Messages: Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests failed with: TestsFailedException: 1 tests failed This message is automatically generated.
        Prasad Mujumdar made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Prasad Mujumdar added a comment -
        Show
        Prasad Mujumdar added a comment - Review request on https://reviews.apache.org/r/13315/
        Prasad Mujumdar made changes -
        Field Original Value New Value
        Attachment HIVE-5006.1.patch [ 12596294 ]
        Prasad Mujumdar created issue -

          People

          • Assignee:
            Prasad Mujumdar
            Reporter:
            Prasad Mujumdar
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development