Jonas created IMPALA-10775:
------------------------------
Summary: impala JDBC cannot terminate the query using the CANCEL
method
Key: IMPALA-10775
URL: https://issues.apache.org/jira/browse/IMPALA-10775
Project: IMPALA
Issue Type: Bug
Components: Clients
Affects Versions: 2.1.0, Impala 2.1
Reporter: Jonas
The Hive driver is fine, but the Impala driver uses JDBC the cancel method. The
query has been canceled but is still executing
!https://community.cloudera.com/t5/image/serverpage/image-id/31710iF063215E815FBB94/image-dimensions/1700?v=1.0&px=-1|width=386,height=35!
I used the latest Impala driver and still have this problem
Detailed code:
{code:java}
//代码占位符
public class ImpalaQueryTimeOutTest {
public static void main(String[] args) throws Exception {
Driver driver = (Driver)
Class.forName("com.cloudera.impala.jdbc41.Driver").newInstance();
Properties info = new Properties();
info.put("user", "");
info.put("password", "");
Connection conn =
driver.connect("jdbc:impala://192.168.5.9:21050/default", info);
CompletableFuture.runAsync(() -> {
});
final Statement state = conn.createStatement();
CompletableFuture<Void> future1 = CompletableFuture.runAsync(() -> {
ResultSet resultSet = null;
try {
System.out.println("query");
resultSet = state.executeQuery("select * from g_500w_20col2
limit 1000000");
System.out.println("query complete");
for (int i = 0; i < 100000; i++) {
resultSet.next();
resultSet.getString(1);
if (i % 1000 == 0) {
System.out.println(i);
}
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (resultSet != null) {
resultSet.close();
}
state.close();
} catch (Exception e) {
e.printStackTrace();
}
}
});
Thread.sleep(10);
CompletableFuture<Void> future2 = CompletableFuture.runAsync(() -> {
try {
System.out.println("cancel");
state.cancel();
} catch (Exception e) {
e.printStackTrace();
}
});
future1.get();
future2.get();
Thread.sleep(1000 * 1000);
}
}
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]