Hive
  1. Hive
  2. HIVE-5441

Async query execution doesn't return resultset status

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.12.0
    • Fix Version/s: 0.13.0
    • Component/s: HiveServer2
    • Labels:
      None

      Description

      For synchronous statement execution (SQL as well as metadata and other), the operation handle includes a boolean flag indicating whether the statement returns a resultset. In case of async execution, that's always set to false.

      1. HIVE-5441.1.patch
        7 kB
        Prasad Mujumdar
      2. HIVE-5441.3.patch
        7 kB
        Prasad Mujumdar
      3. HIVE-5441.4.patch
        8 kB
        Prasad Mujumdar

        Issue Links

          Activity

          Prasad Mujumdar created issue -
          Prasad Mujumdar made changes -
          Field Original Value New Value
          Link This issue relates to HIVE-4617 [ HIVE-4617 ]
          Prasad Mujumdar made changes -
          Link This issue is blocked by HIVE-5440 [ HIVE-5440 ]
          Prasad Mujumdar made changes -
          Attachment HIVE-5441.1.patch [ 12606754 ]
          Hide
          Prasad Mujumdar added a comment -
          Show
          Prasad Mujumdar added a comment - Review request on https://reviews.apache.org/r/14486/
          Prasad Mujumdar made changes -
          Attachment HIVE-5441.3.patch [ 12607213 ]
          Prasad Mujumdar made changes -
          Remote Link This issue links to "Review request #14486 (Web Link)" [ 12909 ]
          Hide
          Vaibhav Gumashta added a comment -

          Prasad Mujumdar You might wanna link: HIVE-4321, HIVE-4923. Thanks!

          Show
          Vaibhav Gumashta added a comment - Prasad Mujumdar You might wanna link: HIVE-4321 , HIVE-4923 . Thanks!
          Hide
          Vaibhav Gumashta added a comment -

          Prasad Mujumdar I may be wrong, but from what I see in this patch, this splits execute into compile and run. I am not able to connect it with: "Async query execution doesn't return resultset status". Could I be missing something? Thanks!

          Show
          Vaibhav Gumashta added a comment - Prasad Mujumdar I may be wrong, but from what I see in this patch, this splits execute into compile and run. I am not able to connect it with: "Async query execution doesn't return resultset status". Could I be missing something? Thanks!
          Hide
          Prasad Mujumdar added a comment -

          [~vaibhavgumashta] That's correct. The availability of result is determined by looking at fetchtask of the plan (with an exception of explain). Hence the patch is doing a synchronous compilation and async execution.

          Show
          Prasad Mujumdar added a comment - [~vaibhavgumashta] That's correct. The availability of result is determined by looking at fetchtask of the plan (with an exception of explain). Hence the patch is doing a synchronous compilation and async execution.
          Hide
          Vaibhav Gumashta added a comment -

          Thanks Prasad Mujumdar!

          +1 from me (non-binding).

          Show
          Vaibhav Gumashta added a comment - Thanks Prasad Mujumdar ! +1 from me (non-binding).
          Hide
          Brock Noland added a comment -

          Should this jira be marked PA?

          Show
          Brock Noland added a comment - Should this jira be marked PA?
          Hide
          Prasad Mujumdar added a comment -

          This on top of HIVE-5440 patch which is not committed yet.

          Show
          Prasad Mujumdar added a comment - This on top of HIVE-5440 patch which is not committed yet.
          Hide
          Vaibhav Gumashta added a comment -

          Prasad Mujumdar I think it will also be useful (another jira maybe) to add a COMPILING OperationState and let the compilation go on asynchronously.

          Show
          Vaibhav Gumashta added a comment - Prasad Mujumdar I think it will also be useful (another jira maybe) to add a COMPILING OperationState and let the compilation go on asynchronously.
          Hide
          Prasad Mujumdar added a comment -

          I did consider that, but wan't convinced that it would be useful in context of this patch. The next step could be to expose the compilation via new message (eg Prepare() ) which can be used for both sync and async execution and add COMPILING as a new state. This would be helpful when porting existing JDBC or ODBC applications originally developed for relational databases.

          Show
          Prasad Mujumdar added a comment - I did consider that, but wan't convinced that it would be useful in context of this patch. The next step could be to expose the compilation via new message (eg Prepare() ) which can be used for both sync and async execution and add COMPILING as a new state. This would be helpful when porting existing JDBC or ODBC applications originally developed for relational databases.
          Hide
          Vaibhav Gumashta added a comment -

          Makes sense. Let me create another jira for that. Thanks!

          Show
          Vaibhav Gumashta added a comment - Makes sense. Let me create another jira for that. Thanks!
          Vaibhav Gumashta made changes -
          Link This issue blocks HIVE-5571 [ HIVE-5571 ]
          Hide
          Vaibhav Gumashta added a comment -

          Prasad Mujumdar Another query: so I'm guessing that after compilation, in the use case you pointed to, you're planning to use the presence of fetch task in the plan (like here: https://github.com/apache/hive/blob/trunk/service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java#L110) to determine if it will generate a result set before the query is run, and not set TOperationHandle#hasResultSet to true?

          Show
          Vaibhav Gumashta added a comment - Prasad Mujumdar Another query: so I'm guessing that after compilation, in the use case you pointed to, you're planning to use the presence of fetch task in the plan (like here: https://github.com/apache/hive/blob/trunk/service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java#L110 ) to determine if it will generate a result set before the query is run, and not set TOperationHandle#hasResultSet to true?
          Hide
          Prasad Mujumdar added a comment -

          That's correct. The existing logic for checking fetch task is not changed as part of this patch.

          Show
          Prasad Mujumdar added a comment - That's correct. The existing logic for checking fetch task is not changed as part of this patch.
          Hide
          Vaibhav Gumashta added a comment -

          cc Brock Noland Thejas M Nair It will be good to get this in if there are no more concerns. Thanks!

          Show
          Vaibhav Gumashta added a comment - cc Brock Noland Thejas M Nair It will be good to get this in if there are no more concerns. Thanks!
          Vaibhav Gumashta made changes -
          Link This issue blocks HIVE-5232 [ HIVE-5232 ]
          Hide
          Vaibhav Gumashta added a comment -

          Linking the async JDBC jira

          Show
          Vaibhav Gumashta added a comment - Linking the async JDBC jira
          Hide
          Thejas M Nair added a comment -

          The patch does not apply cleanly on trunk. Prasad Mujumdar Can you please rebase ?

          Show
          Thejas M Nair added a comment - The patch does not apply cleanly on trunk. Prasad Mujumdar Can you please rebase ?
          Hide
          Thejas M Nair added a comment -

          I have also added a comment to https://reviews.apache.org/r/14486/

          Show
          Thejas M Nair added a comment - I have also added a comment to https://reviews.apache.org/r/14486/
          Hide
          Prasad Mujumdar added a comment -

          Rebased and addressed review feedback.

          Show
          Prasad Mujumdar added a comment - Rebased and addressed review feedback.
          Prasad Mujumdar made changes -
          Attachment HIVE-5441.4.patch [ 12612478 ]
          Hide
          Thejas M Nair added a comment -

          +1

          Show
          Thejas M Nair added a comment - +1
          Hide
          Brock Noland added a comment -

          After seeing Thejas +1, I committed this...then realized tests has not run. I am going to kick off tests manually and verify.

          Show
          Brock Noland added a comment - After seeing Thejas +1, I committed this...then realized tests has not run. I am going to kick off tests manually and verify.
          Hide
          Brock Noland added a comment -

          Tests passed so I won't revert this. Thank you for the contribution Prasad and review Thejas!

          Show
          Brock Noland added a comment - Tests passed so I won't revert this. Thank you for the contribution Prasad and review Thejas!
          Brock Noland made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Fix Version/s 0.13.0 [ 12324986 ]
          Hide
          Hive QA added a comment -

          Overall: -1 no tests executed

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

          Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/486/testReport
          Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/486/console

          Messages:

          Executing org.apache.hive.ptest.execution.PrepPhase
          Tests exited with: NonZeroExitCodeException
          Command 'bash /data/hive-ptest/working/scratch/source-prep.sh' failed with exit status 1 and output '+ [[ -n '' ]]
          + export 'ANT_OPTS=-Xmx1g -XX:MaxPermSize=256m '
          + ANT_OPTS='-Xmx1g -XX:MaxPermSize=256m '
          + export 'M2_OPTS=-Xmx1g -XX:MaxPermSize=256m -Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128'
          + M2_OPTS='-Xmx1g -XX:MaxPermSize=256m -Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128'
          + cd /data/hive-ptest/working/
          + tee /data/hive-ptest/logs/PreCommit-HIVE-Build-486/source-prep.txt
          + [[ false == \t\r\u\e ]]
          + mkdir -p maven ivy
          + [[ svn = \s\v\n ]]
          + [[ -n '' ]]
          + [[ -d apache-svn-trunk-source ]]
          + [[ ! -d apache-svn-trunk-source/.svn ]]
          + [[ ! -d apache-svn-trunk-source ]]
          + cd apache-svn-trunk-source
          + svn revert -R .
          Reverted 'jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java'
          Reverted 'service/src/java/org/apache/hive/service/auth/HiveAuthFactory.java'
          ++ awk '{print $2}'
          ++ egrep -v '^X|^Performing status on external'
          ++ svn status --no-ignore
          + rm -rf target datanucleus.log ant/target shims/target shims/0.20/target shims/assembly/target shims/0.20S/target shims/0.23/target shims/common/target shims/common-secure/target packaging/target hbase-handler/target testutils/target jdbc/target metastore/target itests/target itests/hcatalog-unit/target itests/test-serde/target itests/qtest/target itests/custom-serde/target itests/util/target hcatalog/target hcatalog/storage-handlers/hbase/target hcatalog/server-extensions/target hcatalog/core/target hcatalog/webhcat/svr/target hcatalog/webhcat/java-client/target hcatalog/hcatalog-pig-adapter/target hwi/target common/target common/src/gen service/target contrib/target serde/target beeline/target odbc/target cli/target ql/dependency-reduced-pom.xml ql/target
          + svn update
          
          Fetching external item into 'hcatalog/src/test/e2e/harness'
          External at revision 1547163.
          
          At revision 1547163.
          + patchCommandPath=/data/hive-ptest/working/scratch/smart-apply-patch.sh
          + patchFilePath=/data/hive-ptest/working/scratch/build.patch
          + [[ -f /data/hive-ptest/working/scratch/build.patch ]]
          + chmod +x /data/hive-ptest/working/scratch/smart-apply-patch.sh
          + /data/hive-ptest/working/scratch/smart-apply-patch.sh /data/hive-ptest/working/scratch/build.patch
          The patch does not appear to apply with p0, p1, or p2
          + exit 1
          '
          

          This message is automatically generated.

          ATTACHMENT ID: 12612478

          Show
          Hive QA added a comment - Overall : -1 no tests executed Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12612478/HIVE-5441.4.patch Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/486/testReport Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/486/console Messages: Executing org.apache.hive.ptest.execution.PrepPhase Tests exited with: NonZeroExitCodeException Command 'bash /data/hive-ptest/working/scratch/source-prep.sh' failed with exit status 1 and output '+ [[ -n '' ]] + export 'ANT_OPTS=-Xmx1g -XX:MaxPermSize=256m ' + ANT_OPTS='-Xmx1g -XX:MaxPermSize=256m ' + export 'M2_OPTS=-Xmx1g -XX:MaxPermSize=256m -Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128' + M2_OPTS='-Xmx1g -XX:MaxPermSize=256m -Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128' + cd /data/hive-ptest/working/ + tee /data/hive-ptest/logs/PreCommit-HIVE-Build-486/source-prep.txt + [[ false == \t\r\u\e ]] + mkdir -p maven ivy + [[ svn = \s\v\n ]] + [[ -n '' ]] + [[ -d apache-svn-trunk-source ]] + [[ ! -d apache-svn-trunk-source/.svn ]] + [[ ! -d apache-svn-trunk-source ]] + cd apache-svn-trunk-source + svn revert -R . Reverted 'jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java' Reverted 'service/src/java/org/apache/hive/service/auth/HiveAuthFactory.java' ++ awk '{print $2}' ++ egrep -v '^X|^Performing status on external' ++ svn status --no-ignore + rm -rf target datanucleus.log ant/target shims/target shims/0.20/target shims/assembly/target shims/0.20S/target shims/0.23/target shims/common/target shims/common-secure/target packaging/target hbase-handler/target testutils/target jdbc/target metastore/target itests/target itests/hcatalog-unit/target itests/test-serde/target itests/qtest/target itests/custom-serde/target itests/util/target hcatalog/target hcatalog/storage-handlers/hbase/target hcatalog/server-extensions/target hcatalog/core/target hcatalog/webhcat/svr/target hcatalog/webhcat/java-client/target hcatalog/hcatalog-pig-adapter/target hwi/target common/target common/src/gen service/target contrib/target serde/target beeline/target odbc/target cli/target ql/dependency-reduced-pom.xml ql/target + svn update Fetching external item into 'hcatalog/src/test/e2e/harness' External at revision 1547163. At revision 1547163. + patchCommandPath=/data/hive-ptest/working/scratch/smart-apply-patch.sh + patchFilePath=/data/hive-ptest/working/scratch/build.patch + [[ -f /data/hive-ptest/working/scratch/build.patch ]] + chmod +x /data/hive-ptest/working/scratch/smart-apply-patch.sh + /data/hive-ptest/working/scratch/smart-apply-patch.sh /data/hive-ptest/working/scratch/build.patch The patch does not appear to apply with p0, p1, or p2 + exit 1 ' This message is automatically generated. ATTACHMENT ID: 12612478
          Hide
          Vaibhav Gumashta added a comment -

          Thejas M Nair Prasad Mujumdar I think this slipped out of sight. Since it has already been +1-ed, I think we can get this in.

          Show
          Vaibhav Gumashta added a comment - Thejas M Nair Prasad Mujumdar I think this slipped out of sight. Since it has already been +1-ed, I think we can get this in.
          Hide
          Thejas M Nair added a comment -

          This has already been committed, marking as fixed.

          Show
          Thejas M Nair added a comment - This has already been committed, marking as fixed.
          Thejas M Nair made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Patch Available Patch Available
          59d 10h 5m 1 Brock Noland 02/Dec/13 18:01
          Patch Available Patch Available Resolved Resolved
          35d 2h 30m 1 Thejas M Nair 06/Jan/14 20:31

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development