Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.8.0
-
None
Description
When a query fails while executing, the following events happen:
- the exception is added to FragmentContext.deferredException
- the FragmentExecutor reports the failure to the client through the Foreman
- the FragmentExecutor closes the DeferredException
- DeferredException.close() throws back the original exception
- FragmentExecutor.run() catches the exception and try to add it to the DeferredException
- DeferredException.addException() throws an IllegalStateException because it's already closed.
You can reproduce this by querying the following json file, which contains an extra ":"
{ "a1": 0 , "b1": "a"} { "a1": 1 , "b1": "b"} { "a1": 2 , "b1": "c"} { "a1":: 3 , "b1": "c"}
Sqlline will dispaly both the error message sent by the Foreman and the IllegalStateException:
0: jdbc:drill:zk=local> select * from `t.json`; Query failed: Query stopped., Unexpected character (':' (code 58)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [Source: org.apache.drill.exec.vector.complex.fn.JsonReader@161188d3; line: 3, column: 9] [ b55f7d53-0e88-456f-bb12-160cacae9222 on administorsmbp2.attlocal.net:31010 ] Error: exception while executing query: Failure while executing query. (state=,code=0) 0: jdbc:drill:zk=local> Exception in thread "WorkManager-2" java.lang.IllegalStateException at com.google.common.base.Preconditions.checkState(Preconditions.java:133) at org.apache.drill.common.DeferredException.addException(DeferredException.java:47) at org.apache.drill.common.DeferredException.addThrowable(DeferredException.java:61) at org.apache.drill.exec.ops.FragmentContext.fail(FragmentContext.java:135) at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:181) at org.apache.drill.common.SelfCleaningRunnable.run(SelfCleaningRunnable.java:38) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)