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

Function parse_query_test_file

tests/util/test_file_parser.py:89–107  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

87
88
89def 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
110def parse_table_constraints(constraints_file):

Callers 2

load_query_test_fileMethod · 0.90
load_tpc_queriesFunction · 0.85

Calls 1

parse_test_fileFunction · 0.85

Tested by

no test coverage detected