[
https://issues.apache.org/jira/browse/IMPALA-7031?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16550510#comment-16550510
]
Adriano commented on IMPALA-7031:
-
Hi [~tarmstrong], sorry to answer with delay.
I made some tests on Impala 2.10 (C5.13, but most probably this behaviour is
only in the next versions):
* from the Impala WebUi we can only cancel the query in flight, in this case:
!Screen Shot 2018-07-20 at 10.19.42.png!
* the coordinator will cancel the query as requested:
{code:java}
I0720 01:03:52.288815 28385 status.cc:122] Cancelled from Impala's debug web
interface
@ 0x83e789 impala::Status::Status()
@ 0xabce21 impala::ImpalaHttpHandler::CancelQueryHandler()
@ 0xbdb7da impala::Webserver::RenderUrlWithTemplate()
@ 0xbdcd27 impala::Webserver::BeginRequestCallback()
@ 0xbe9a70 (unknown)
@ 0xbec1ed (unknown)
@ 0xbec87d (unknown)
@ 0x7f301df39aa1 start_thread
@ 0x7f301dc86c4d clone
I0720 01:03:52.288822 28385 impala-server.cc:989] UnregisterQuery():
query_id=944b1add28b19313:eb712db1
I0720 01:03:52.288844 28385 impala-server.cc:1075] Cancel():
query_id=944b1add28b19313:eb712db1
I0720 01:03:52.288862 28385 coordinator.cc:910] Cancel()
query_id=944b1add28b19313:eb712db1
I0720 01:03:52.288868 28385 coordinator-backend-state.cc:367] sending
CancelQueryFInstances rpc for query_id=944b1add28b19313:eb712db1
backend=host-10-17-102-61.coe.cloudera.com:22000
I0720 01:03:52.288873 28385 client-cache.cc:46]
GetClient(host-10-17-102-61.coe.cloudera.com:22000)
I0720 01:03:52.288877 28385 client-cache.cc:56] GetClient(): returning cached
client for host-10-17-102-61.coe.cloudera.com:22000
I0720 01:03:52.288935 28314 rpc-trace.cc:190] RPC call:
ImpalaInternalService.CancelQueryFInstances(from 10.17.102.61:57249)
I0720 01:03:52.288945 28314 impala-internal-service.cc:63]
CancelQueryFInstances(): query_id=944b1add28b19313:eb712db1
{code}
* On the client side the query fail with the error below:
{code:java}
java.sql.SQLException: [Simba][ImpalaJDBCDriver](500051) ERROR processing
query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS,
sqlState:HY000, errorMessage:Invalid query handle:
944b1add28b19313:eb712db1), Query: SELECT COUNT(*) as `expr_0` FROM
`db`.`table`.
at com.cloudera.hivecommon.api.HS2Client.executeStatementInternal(Unknown
Source)
at com.cloudera.hivecommon.api.HS2Client.executeStatement(Unknown Source)
at
com.cloudera.hivecommon.dataengine.HiveJDBCNativeQueryExecutor.executeQuery(Unknown
Source)
at
com.cloudera.hivecommon.dataengine.HiveJDBCDSIExtQueryExecutor.execute(Unknown
Source)
at com.cloudera.jdbc.common.SStatement.executeNoParams(Unknown Source)
at com.cloudera.jdbc.common.SStatement.executeQuery(Unknown Source)
at JdbcTest.runTest(JdbcTest.java:43)
Caused by: com.cloudera.support.exceptions.GeneralException:
[Simba][ImpalaJDBCDriver](500051) ERROR processing query/statement. Error Code:
0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000,
errorMessage:Invalid query handle: 944b1add28b19313:eb712db1), Query:
SELECT COUNT(*) as `expr_0` FROM `db`.`table`.
... 7 more{code}
* Because the coordinator provide this answer if the query is closed/cancelled
{code:java}
I0720 01:03:52.301568 28384 status.cc:55] ReportExecStatus(): Received report
for unknown query ID (probably closed or cancelled):
944b1add28b19313:eb712db1
@ 0x83d66a impala::Status::Status()
@ 0xa90176 impala::ImpalaServer::ReportExecStatus()
@ 0xd4b60e
impala::ImpalaInternalServiceProcessor::process_ReportExecStatus()
@ 0xd47859 impala::ImpalaInternalServiceProcessor::dispatchCall()
@ 0x80e4ac apache::thrift::TDispatchProcessor::process()
@ 0x9d9edf
apache::thrift::server::TAcceptQueueServer::Task::run()
@ 0x9d44f9 impala::ThriftThread::RunRunnable()
@ 0x9d52d2
boost::detail::function::void_function_obj_invoker0<>::invoke()
@ 0xbd3fa2 impala::Thread::SuperviseThread()
@ 0xbd4704 boost::detail::thread_data<>::run()
@ 0xe608ea (unknown)
@ 0x7f301df39aa1 start_thread
@ 0x7f301dc86c4d clone
{code}
>From the client/user prospective the error "Invalid query handle" is not
>indicative and they think that something is broken (ignoring that someone else
>cancelled the query using the Administrative WebUi). If in the future we can
>provide some more info on the reason why the query failed will be good.
PS: I was able to replicate also the "waiting to be closed" state but there we
have no errors on the client side (the effect is that the query will stay in
waiting to be closed on the