Reads the specified query test file accepting the given list of valid section names Uses a default list of valid section names if valid_section_names is None Returns the result as a list of dictionaries. Each dictionary in the list corresponds to a test case and each key in the dictionary
(file_name, valid_section_names=None, encoding=None)
| 87 | |
| 88 | |
| 89 | def parse_query_test_file(file_name, valid_section_names=None, encoding=None): |
| 90 | """ |
| 91 | Reads the specified query test file accepting the given list of valid section names |
| 92 | Uses a default list of valid section names if valid_section_names is None |
| 93 | |
| 94 | Returns the result as a list of dictionaries. Each dictionary in the list corresponds |
| 95 | to a test case and each key in the dictionary maps to a section in that test case. |
| 96 | """ |
| 97 | # Update the valid section names as we support other test types |
| 98 | # (ex. planner, data error) |
| 99 | section_names = valid_section_names |
| 100 | if section_names is None: |
| 101 | section_names = ['QUERY', 'HIVE_QUERY', 'RESULTS', 'TYPES', 'LABELS', 'SETUP', |
| 102 | 'CATCH', 'ERRORS', 'USER', 'RUNTIME_PROFILE', 'SHELL', 'DML_RESULTS', |
| 103 | 'HS2_TYPES', 'HIVE_MAJOR_VERSION', 'LINEAGE', 'IS_HDFS_ONLY', |
| 104 | 'CALCITE_PLANNER_RESULTS', 'CALCITE_PLANNER_CATCH', |
| 105 | 'CALCITE_PLANNER_RUNTIME_PROFILE'] |
| 106 | return parse_test_file(file_name, section_names, encoding=encoding, |
| 107 | skip_unknown_sections=False) |
| 108 | |
| 109 | |
| 110 | def parse_table_constraints(constraints_file): |
no test coverage detected