Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion ibis-server/app/model/metadata/trino.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"bool": RustWrenEngineColumnType.BOOL,
"boolean": RustWrenEngineColumnType.BOOL,
# Decimal Types
"real": RustWrenEngineColumnType.REAL,
"float": RustWrenEngineColumnType.FLOAT4,
"double": RustWrenEngineColumnType.DOUBLE,
"decimal": RustWrenEngineColumnType.DECIMAL,
Expand Down Expand Up @@ -148,8 +149,15 @@ def _transform_column_type(self, data_type: str) -> RustWrenEngineColumnType:
Returns:
The corresponding RustWrenEngineColumnType
"""
lower_type = data_type.strip().lower()

# Handle complex/parametric types: preserve original type string
# (consistent with BigQuery and Databricks implementations)
if lower_type.startswith(("array", "map", "row")):
return data_type

# Remove parameter specifications like VARCHAR(255) -> VARCHAR
normalized_type = re.sub(r"\(.*\)", "", data_type).strip().lower()
normalized_type = re.sub(r"\(.*\)", "", lower_type).strip()

# Use the module-level mapping table
mapped_type = TRINO_TYPE_MAPPING.get(
Expand Down
Loading