| 143 | self.client.log_client('Stop fetching results') |
| 144 | |
| 145 | def cancel_query(self): |
| 146 | assert self.handle is not None, \ |
| 147 | "handle is None. Did the query fail to start?" |
| 148 | if self.use_kill_query_statement: |
| 149 | # Run kill query using ImpylaHS2Connection. |
| 150 | with create_connection( |
| 151 | host_port=self.client.get_host_port(), |
| 152 | protocol=self.client.get_test_protocol(), |
| 153 | ) as kill_client: |
| 154 | kill_client.connect() |
| 155 | if self.exec_option: |
| 156 | kill_client.set_configuration(self.exec_option) |
| 157 | assert_kill_ok(kill_client, self.client.handle_id(self.handle)) |
| 158 | else: |
| 159 | # Run cancellation using separate client/connection. |
| 160 | with MinimalHS2Connection(IMPALAD_HS2_HOST_PORT) as cancel_client: |
| 161 | cancel_resp = cancel_client.cancel(self.handle) |
| 162 | assert cancel_resp.status.statusCode == TCLIService.TStatusCode.SUCCESS_STATUS |
| 163 | |
| 164 | def close_query(self): |
| 165 | with MinimalHS2Connection(IMPALAD_HS2_HOST_PORT) as close_client: |