From 9cb147c87e71c93fd928f9879e0cba86bf33c4f5 Mon Sep 17 00:00:00 2001 From: okayhooni Date: Tue, 17 Mar 2026 19:18:43 +0900 Subject: [PATCH] fix real type & nested composite type mapping for Trino engine --- ibis-server/app/model/metadata/trino.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ibis-server/app/model/metadata/trino.py b/ibis-server/app/model/metadata/trino.py index 1070ff88b..7ff093cd0 100644 --- a/ibis-server/app/model/metadata/trino.py +++ b/ibis-server/app/model/metadata/trino.py @@ -38,6 +38,7 @@ "bool": RustWrenEngineColumnType.BOOL, "boolean": RustWrenEngineColumnType.BOOL, # Decimal Types + "real": RustWrenEngineColumnType.REAL, "float": RustWrenEngineColumnType.FLOAT4, "double": RustWrenEngineColumnType.DOUBLE, "decimal": RustWrenEngineColumnType.DECIMAL, @@ -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(