Zsolt Tóth created HIVE-13626:
---------------------------------

             Summary: Unable to cancel certain queries [Spark Branch]
                 Key: HIVE-13626
                 URL: https://issues.apache.org/jira/browse/HIVE-13626
             Project: Hive
          Issue Type: Bug
          Components: Spark
         Environment: CDH5.7 single node docker
            Reporter: Zsolt Tóth


To reproduce:
1. Submit a query to Hive through JDBC
2. Cancel (almost) immediately

For the query _SELECT DISTINCT a FROM test_ the Hive log says: 
"java.lang.Exception: Failed to submit Spark work, please retry later" ... 
"Caused by: java.io.IOException: java.lang.InterruptedException". After I call 
close() on the statement and the connection, the application changes to 
FINISHED/SUCCEEDED state (as expected).

However, for the query _SELECT a FROM test order by a_  Hive log says: 
"org.apache.hadoop.hive.ql.metadata.HiveException: Failed to create spark 
client." ... "Caused by: java.lang.RuntimeException: 
java.lang.InterruptedException". Calling close() seems to have no effect, the 
yarn application is stuck in RUNNING state.

If I cancel the second query later (e.g. after 10 secs), the application closes 
with FINISHED/SUCCEEDED (as expected).

Code snippet:
{code:title=Bar.java|borderStyle=solid}
final Statement st = connection.createStatement();
new Thread() {
        @Override
        public void run() {
                sleep(100);
                st.cancel();
        }
}.start();

ResultSet r = null;
try {
        // r = st.executeQuery("SELECT DISTINCT a FROM test");
        r = st.executeQuery("SELECT a FROM test order by a");
} catch (SQLException e) {
        close(r);
        if (st != null) {
                st.close();
        }
        if (connection != null) {
                connection.close();
        }
}
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to