MCPcopy Create free account
hub / github.com/apache/impala / test_fetch_size

Method test_fetch_size

tests/shell/test_shell_client.py:45–62  ·  view source on GitHub ↗

Tests that when result spooling is disabled, setting a small batch_size causes the shell to fetch a single batch at a time, even when the configured fetch size is larger than the batch_size.

(self, vector)

Source from the content-addressed store, hash-verified

43 cls.ImpalaTestMatrix.add_dimension(create_client_protocol_no_strict_dimension())
44
45 def test_fetch_size(self, vector):
46 """Tests that when result spooling is disabled, setting a small batch_size causes
47 the shell to fetch a single batch at a time, even when the configured fetch size is
48 larger than the batch_size."""
49 handle = None
50 num_rows = 100
51 batch_size = 10
52 query_options = {'batch_size': str(batch_size), 'spool_query_results': 'false'}
53 client = self.__get_shell_client(vector)
54
55 try:
56 client.connect()
57 handle = client.execute_query(
58 "select * from functional.alltypes limit {0}".format(num_rows), query_options)
59 self.__fetch_rows(client.fetch(handle), batch_size, num_rows)
60 finally:
61 if handle is not None: client.close_query(handle)
62 client.close_connection()
63
64 def test_fetch_size_result_spooling(self, vector):
65 """Tests that when result spooling is enabled, that the exact fetch_size is honored

Callers

nothing calls this directly

Calls 8

__get_shell_clientMethod · 0.95
__fetch_rowsMethod · 0.95
connectMethod · 0.45
execute_queryMethod · 0.45
formatMethod · 0.45
fetchMethod · 0.45
close_queryMethod · 0.45
close_connectionMethod · 0.45

Tested by

no test coverage detected