Xuebin Su has uploaded a new patch set (#7). ( http://gerrit.cloudera.org:8080/22280 )
Change subject: IMPALA-13566: Expose query cancellation status to UDFs ...................................................................... IMPALA-13566: Expose query cancellation status to UDFs Previously, the evaluation of a UDF was not interruptible. When the impalad was evaluating a UDF on a batch, the client would have to wait for the end of processing the batch before it could get the results or cancel the query. Such a period could be long if the UDF takes a long time to run, e.g. the sleep() UDF. This patch tries to mitigate this issue by exposing the query cancellation status in RuntimeState to the UDF so that the UDF can check the status by itself and return early. This can significantly reduce the waiting time when cancelling a long-running query. As an example, this patch makes the sleep() UDF interruptible by checking the query cancellation status inside the UDF every SLEEP_UNINTERRUPTIBLE_INTERVAL_MS. This means that we only need to wait about SLEEP_UNINTERRUPTIBLE_INTERVAL_MS to cancel the query. Testing: - Added a new test case in tests/query_test/test_cancellation.py to ensure that we can interrupt sleep(). - Added a new connection class called HS2Connection in tests/common/impala_connection.py to support manipulating one operation from multiple connections for the new test case. Change-Id: I9430167f7e46bbdf66153abb4645541cd8cf0142 --- M be/src/exprs/utility-functions-ir.cc M be/src/udf/udf.cc M be/src/udf/udf.h M tests/common/impala_connection.py M tests/query_test/test_cancellation.py 5 files changed, 182 insertions(+), 8 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/80/22280/7 -- To view, visit http://gerrit.cloudera.org:8080/22280 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9430167f7e46bbdf66153abb4645541cd8cf0142 Gerrit-Change-Number: 22280 Gerrit-PatchSet: 7 Gerrit-Owner: Xuebin Su <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Surya Hebbar <[email protected]>
