def test_presto_remove_processed_array_columns(self): array_col_hierarchy = { "array_column": { "type": "ARRAY", "children": ["array_column.nested_array"], }, "array_column.nested_array": { "type": "ARRAY", "children": ["array_column.nested_array.nested_obj"], }, } unprocessed_array_cols = {"array_column.nested_array"} PrestoEngineSpec._remove_processed_array_columns( unprocessed_array_cols, array_col_hierarchy) expected_array_col_hierarchy = { "array_column.nested_array": { "type": "ARRAY", "children": ["array_column.nested_array.nested_obj"], } } self.assertEqual(array_col_hierarchy, expected_array_col_hierarchy)
def test_presto_remove_processed_array_columns(self): array_col_hierarchy = { 'array_column': { 'type': 'ARRAY', 'children': ['array_column.nested_array'], }, 'array_column.nested_array': { 'type': 'ARRAY', 'children': ['array_column.nested_array.nested_obj'] }, } unprocessed_array_cols = {'array_column.nested_array'} PrestoEngineSpec._remove_processed_array_columns( unprocessed_array_cols, array_col_hierarchy) expected_array_col_hierarchy = { 'array_column.nested_array': { 'type': 'ARRAY', 'children': ['array_column.nested_array.nested_obj'] }, } self.assertEqual(array_col_hierarchy, expected_array_col_hierarchy)