本文整理匯總了Python中util.ImpalaShell.wait_for_query_start方法的典型用法代碼示例。如果您正苦於以下問題:Python ImpalaShell.wait_for_query_start方法的具體用法?Python ImpalaShell.wait_for_query_start怎麽用?Python ImpalaShell.wait_for_query_start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類util.ImpalaShell
的用法示例。
在下文中一共展示了ImpalaShell.wait_for_query_start方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_cancellation
# 需要導入模塊: from util import ImpalaShell [as 別名]
# 或者: from util.ImpalaShell import wait_for_query_start [as 別名]
def test_cancellation(self, vector):
"""Test cancellation (Ctrl+C event). Run a query that sleeps 10ms per row so will run
for 110s if not cancelled, but will detect cancellation quickly because of the small
batch size."""
query = "set num_nodes=1; set mt_dop=1; set batch_size=1; \
select sleep(10) from functional_parquet.alltypesagg"
p = ImpalaShell(vector, ['-q', query])
p.wait_for_query_start()
os.kill(p.pid(), signal.SIGINT)
result = p.get_result()
assert "Cancelling Query" in result.stderr, result.stderr