Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-6535

JDBC: provide an async API to execute query and fetch results

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.14.0, 1.2.1, 2.0.0
    • Fix Version/s: 2.1.0
    • Component/s: HiveServer2, JDBC
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed
    • Release Note:
      Hide
      Introduced new method HiveStatement.executeAsync - Starts the query execution asynchronously on the server, and immediately returns to the client. The client subsequently blocks on ResultSet#next or Statement#getUpdateCount, depending on the query type. Users should call ResultSet.next or Statement#getUpdateCount (depending on whether query returns results) to ensure that query completes successfully. Calling another execute method, or close before query completion would result in the async query getting killed if it is not already finished.
      Note: This method is an API for limited usage outside of Hive by applications like Apache Ambari, although it is not part of the interface java.sql.Statement.
      Show
      Introduced new method HiveStatement.executeAsync - Starts the query execution asynchronously on the server, and immediately returns to the client. The client subsequently blocks on ResultSet#next or Statement#getUpdateCount, depending on the query type. Users should call ResultSet.next or Statement#getUpdateCount (depending on whether query returns results) to ensure that query completes successfully. Calling another execute method, or close before query completion would result in the async query getting killed if it is not already finished. Note: This method is an API for limited usage outside of Hive by applications like Apache Ambari, although it is not part of the interface java.sql.Statement.

      Description

      The hive jdbc client waits query completion during execute() call. It would be better to block in the jdbc for completion when the results are being fetched.
      This way the application using hive jdbc driver can do other tasks while asynchronous query execution is happening, until it needs to fetch the result set.

        Attachments

        1. HIVE-6535.6.patch
          23 kB
          Vaibhav Gumashta
        2. HIVE-6535.5.patch
          22 kB
          Vaibhav Gumashta
        3. HIVE-6535.4.patch
          22 kB
          Vaibhav Gumashta
        4. HIVE-6535.3.patch
          18 kB
          Vaibhav Gumashta
        5. HIVE-6535.2.patch
          22 kB
          Vaibhav Gumashta
        6. HIVE-6535.1.patch
          6 kB
          Vaibhav Gumashta

          Issue Links

            Activity

              People

              • Assignee:
                vgumashta Vaibhav Gumashta
                Reporter:
                thejas Thejas Nair
              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: