Builds a query exec option test dimension Exhaustively goes through all combinations of the given query option values. For each combination create an exec option dictionary and add it as a value in the exec option test dimension. Each dictionary can then be passed via Beeswax to control
(exec_option_dimensions)
| 280 | |
| 281 | |
| 282 | def create_exec_option_dimension_from_dict(exec_option_dimensions): |
| 283 | """ |
| 284 | Builds a query exec option test dimension |
| 285 | |
| 286 | Exhaustively goes through all combinations of the given query option values. |
| 287 | For each combination create an exec option dictionary and add it as a value in the |
| 288 | exec option test dimension. Each dictionary can then be passed via Beeswax to control |
| 289 | Impala query execution behavior. |
| 290 | |
| 291 | TODO: In the future we could generate these values using pairwise to reduce total |
| 292 | execution time. |
| 293 | """ |
| 294 | # Generate the cross product (all combinations) of the exec options specified. Then |
| 295 | # store them in exec_option dictionary format. |
| 296 | keys = sorted(exec_option_dimensions) |
| 297 | for name in keys: |
| 298 | assert_exec_option_key(name) |
| 299 | combinations = product(*(exec_option_dimensions[name] for name in keys)) |
| 300 | exec_option_dimension_values = [dict(zip(keys, prod)) for prod in combinations] |
| 301 | |
| 302 | # Build a test vector out of it |
| 303 | return ImpalaTestDimension(EXEC_OPTION, *exec_option_dimension_values) |
| 304 | |
| 305 | |
| 306 | def add_exec_option_dimension(test_suite, key, values): |
no test coverage detected