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

Method get_session_options

tests/hs2/test_hs2.py:89–109  ·  view source on GitHub ↗

Returns dictionary of query options.

(self, setCmd)

Source from the content-addressed store, hash-verified

87 assert sessions.configuration[k] == v
88
89 def get_session_options(self, setCmd):
90 """Returns dictionary of query options."""
91 execute_statement_resp = self.execute_statement(setCmd)
92
93 fetch_results_req = TCLIService.TFetchResultsReq()
94 fetch_results_req.operationHandle = execute_statement_resp.operationHandle
95 fetch_results_req.maxRows = 1000
96 fetch_results_resp = self.hs2_client.FetchResults(fetch_results_req)
97 TestHS2.check_response(fetch_results_resp)
98
99 # Close the query
100 close_operation_req = TCLIService.TCloseOperationReq()
101 close_operation_req.operationHandle = execute_statement_resp.operationHandle
102 TestHS2.check_response(self.hs2_client.CloseOperation(close_operation_req))
103
104 # Results are returned in a columnar way:
105 cols = fetch_results_resp.results.columns
106 assert len(cols) == 3
107 vals = dict(zip(cols[0].stringVal.values, cols[1].stringVal.values))
108 levels = dict(zip(cols[0].stringVal.values, cols[2].stringVal.values))
109 return vals, levels
110
111 @needs_session()
112 def test_session_options_via_set(self):

Calls 5

zipFunction · 0.85
execute_statementMethod · 0.80
check_responseMethod · 0.80
FetchResultsMethod · 0.45
CloseOperationMethod · 0.45

Tested by

no test coverage detected