diff --git a/superset/db_engine_specs/presto.py b/superset/db_engine_specs/presto.py index 9bc9307ea7a56..3f92d67e97ce3 100644 --- a/superset/db_engine_specs/presto.py +++ b/superset/db_engine_specs/presto.py @@ -255,7 +255,7 @@ def _parse_structural_column( # pylint: disable=too-many-locals,too-many-branch full_parent_path = cls._get_full_name(stack) result.append( cls._create_column_info( - full_parent_path, presto_type_map[field_info[1]]() + full_parent_path, presto_type_map[field_info[1].split('(')[0]]() ) ) else: # otherwise this field is a basic data type @@ -265,7 +265,7 @@ def _parse_structural_column( # pylint: disable=too-many-locals,too-many-branch ) result.append( cls._create_column_info( - column_name, presto_type_map[field_info[1]]() + column_name, presto_type_map[field_info[1].split('(')[0]]() ) ) # If the component type ends with a structural data type, do not pop @@ -337,7 +337,8 @@ def get_columns( result[structural_column_index]["default"] = None continue else: # otherwise column is a basic data type - column_type = presto_type_map[column.Type]() + newtyp = column.Type + column_type = presto_type_map[newtyp.split('(')[0]]() except KeyError: logger.info( "Did not recognize type {} of column {}".format( # pylint: disable=logging-format-interpolation