Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Not A Bug
-
Impala 1.2.3
-
None
-
None
Description
When "COMPUTE STATS <table>" is called from JDBC driver, it may fail in this case:
- If "compute stats" is the last statement of the session.
- And the client making the call finishes and the jdbc session is closed.
I believe that "COMPUTE STATS" spawns two queries and returns back before those two queries finish. If the jdbc session is closed after that, the two spawned queries will be canceled. Therefore the statement "compute stats" fails without any error being awared by the client.
The spawned two queries for my tables:
- row counts for partitions
- compute column statistics
This problem happens in Impala-shell too if you run the below query. The impala web UI will show two queries have exceptions.
compute stats a_table; quit;
or the two queries may not even be scheduled if running like this:
impala-shell -q "compute stats a_table" impala-shell -q "compute stats a_table; refresh a_table;"
I tried to run "refresh <table>" statement after "COMPUTE STATS", but it is still not reliable because the "REFRESH" statement may be scheduled between the two queries, and there is still a chance that one of queries is canceled.
The better solution might be to let the spawn queries run not associated with the session.