Parse query execution results for the Impala JDBC client Parses the query execution details (avg time, stddev) from the output of the Impala JDBC test client.
(stdout, query)
| 193 | |
| 194 | |
| 195 | def parse_jdbc_query_results(stdout, query): |
| 196 | """ |
| 197 | Parse query execution results for the Impala JDBC client |
| 198 | |
| 199 | Parses the query execution details (avg time, stddev) from the output of the Impala |
| 200 | JDBC test client. |
| 201 | """ |
| 202 | jdbc_result_regex = r'row\(s\) in (\d*).(\d*)s' |
| 203 | time_taken = 0.0 |
| 204 | for line in stdout.split('\n'): |
| 205 | match = re.search(jdbc_result_regex, line) |
| 206 | if match: |
| 207 | time_taken = float(('%s.%s') % (match.group(1), match.group(2))) |
| 208 | break |
| 209 | result_data = re.findall(r'\[START\]----\n(.*?)\n----\[END\]', stdout, re.DOTALL)[0] |
| 210 | return create_exec_result(time_taken, result_data, query) |
| 211 | |
| 212 | |
| 213 | def create_exec_result(time_taken, result_data, query): |
no test coverage detected