@Override
      public void run() {
        try {
          System.out.println("Executing query: ");
          stmt.executeQuery("select sleepUDF(t1.under_col) as u0, t1.under_col as u1, " +
              "t2.under_col as u2 from " + tableName +  "t1 join " + tableName +
              " t2 on t1.under_col = t2.under_col");
          fail("Expecting SQLException");
        } catch (SQLException e) {
          // This thread should throw an exception
          assertNotNull(e);
          System.out.println(e.toString());
        }
      }
Test the cancellation of a query that is running.
We spawn 2 threads - one running the query and
the other attempting to cancel.
We're using a dummy udf to simulate a query,
that runs for a sufficiently long time.
@throws Exception
itests/hive-unit/src/test/java/org/apache/hive/jdbc/cbo_rp_TestJdbcDriver2.java