Hive
  1. Hive
  2. HIVE-6712

HS2 JDBC driver is inconsistent w.r.t. auto commit

    Details

    • Type: Bug Bug
    • Status: Patch Available
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.13.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Hadoop Flags:
      Incompatible change
    • Release Note:
      Hide
      Changes the behavior of setAutoCommit to allow setAutoCommit(true) to succeed silently and setAutoCommit(false) to throw an exception and fail, as all Hive transactions automatically commit and hive does not yet support manual transactions (see https://cwiki.apache.org/confluence/display/Hive/Hive+Transactions#HiveTransactions-Limitations).
      Show
      Changes the behavior of setAutoCommit to allow setAutoCommit(true) to succeed silently and setAutoCommit(false) to throw an exception and fail, as all Hive transactions automatically commit and hive does not yet support manual transactions (see https://cwiki.apache.org/confluence/display/Hive/Hive+Transactions#HiveTransactions-Limitations) .

      Description

      I see an inconsistency in HS2 JDBC driver code:

        @Override
        public void setAutoCommit(boolean autoCommit) throws SQLException {
          if (autoCommit) {
            throw new SQLException("enabling autocommit is not supported");
          }
        }
      

      From above, it seems that auto commit is not supported. However,

        @Override
        public boolean getAutoCommit() throws SQLException {
          return true;
        }
      
      1. HIVE-6712.patch
        1 kB
        David McWhorter

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Patch Available Patch Available
          579d 20m 1 David McWhorter 20/Oct/15 20:39
          Sergey Shelukhin made changes -
          Fix Version/s 2.0.0 [ 12332641 ]
          Hide
          Sergey Shelukhin added a comment -

          Removing fixed version (2.0) from Unresolved JIRA in preparation for the release. Please use target version field instead (if not already set) if you think this should be shipped as part of 2.0

          Show
          Sergey Shelukhin added a comment - Removing fixed version (2.0) from Unresolved JIRA in preparation for the release. Please use target version field instead (if not already set) if you think this should be shipped as part of 2.0
          Hide
          Hive QA added a comment -

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

          ERROR: -1 due to no test(s) being added or modified.

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

          org.apache.hive.hcatalog.api.TestHCatClient.testTableSchemaPropagation
          org.apache.hive.jdbc.TestSSL.testSSLVersion
          

          Test results: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/5715/testReport
          Console output: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/5715/console
          Test logs: http://ec2-174-129-184-35.compute-1.amazonaws.com/logs/PreCommit-HIVE-TRUNK-Build-5715/

          Messages:

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

          This message is automatically generated.

          ATTACHMENT ID: 12767662 - PreCommit-HIVE-TRUNK-Build

          Show
          Hive QA added a comment - Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12767662/HIVE-6712.patch ERROR: -1 due to no test(s) being added or modified. ERROR: -1 due to 2 failed/errored test(s), 9697 tests executed Failed tests: org.apache.hive.hcatalog.api.TestHCatClient.testTableSchemaPropagation org.apache.hive.jdbc.TestSSL.testSSLVersion Test results: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/5715/testReport Console output: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/5715/console Test logs: http://ec2-174-129-184-35.compute-1.amazonaws.com/logs/PreCommit-HIVE-TRUNK-Build-5715/ Messages: Executing org.apache.hive.ptest.execution.TestCheckPhase Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 2 tests failed This message is automatically generated. ATTACHMENT ID: 12767662 - PreCommit-HIVE-TRUNK-Build
          Hide
          Xuefu Zhang added a comment -

          +1, looks good to me.

          Show
          Xuefu Zhang added a comment - +1, looks good to me.
          David McWhorter made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Release Note Changes the behavior of setAutoCommit to allow setAutoCommit(true) to succeed silently and setAutoCommit(false) to throw an exception and fail, as all Hive transactions automatically commit and hive does not yet support manual transactions (see https://cwiki.apache.org/confluence/display/Hive/Hive+Transactions#HiveTransactions-Limitations).
          Fix Version/s 2.0.0 [ 12332641 ]
          Hadoop Flags Incompatible change [ 10342 ]
          Labels jdbc
          David McWhorter made changes -
          Attachment HIVE-6712.patch [ 12767662 ]
          Hide
          David McWhorter added a comment -

          This patch changes the behavior of setAutoCommit to allow setAutoCommit(true) to succeed silently and setAutoCommit(false) to throw an exception and fail, as all Hive transactions automatically commit and hive does not yet support manual transactions (see https://cwiki.apache.org/confluence/display/Hive/Hive+Transactions#HiveTransactions-Limitations).

          Show
          David McWhorter added a comment - This patch changes the behavior of setAutoCommit to allow setAutoCommit(true) to succeed silently and setAutoCommit(false) to throw an exception and fail, as all Hive transactions automatically commit and hive does not yet support manual transactions (see https://cwiki.apache.org/confluence/display/Hive/Hive+Transactions#HiveTransactions-Limitations ).
          David McWhorter made changes -
          Assignee David McWhorter [ dmcwhorter ]
          Navis made changes -
          Field Original Value New Value
          Link This issue duplicates HIVE-6705 [ HIVE-6705 ]
          Xuefu Zhang created issue -

            People

            • Assignee:
              David McWhorter
              Reporter:
              Xuefu Zhang
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Development