From a15111679fad74998b33a488c8e6f78a6f1103c2 Mon Sep 17 00:00:00 2001 From: Marcelo Nunes Alves Date: Thu, 12 Feb 2026 16:49:31 -0300 Subject: [PATCH] Fix ClickHouse Decimal/Numeric and Nullable Type Mapping --- ibis-server/app/model/metadata/clickhouse.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ibis-server/app/model/metadata/clickhouse.py b/ibis-server/app/model/metadata/clickhouse.py index 8121cf6f0..ca4657a78 100644 --- a/ibis-server/app/model/metadata/clickhouse.py +++ b/ibis-server/app/model/metadata/clickhouse.py @@ -28,6 +28,7 @@ "float32": RustWrenEngineColumnType.FLOAT4, "float64": RustWrenEngineColumnType.FLOAT8, "decimal": RustWrenEngineColumnType.DECIMAL, + "numeric": RustWrenEngineColumnType.NUMERIC, # Date/Time Types "date": RustWrenEngineColumnType.DATE, "datetime": RustWrenEngineColumnType.TIMESTAMP, @@ -121,6 +122,19 @@ def _transform_column_type(self, data_type: str) -> RustWrenEngineColumnType: # Convert to lowercase for comparison normalized_type = data_type.lower() + # Decimal type with precision and scale + if normalized_type.startswith("decimal"): + return RustWrenEngineColumnType.DECIMAL + + # Numeric type with precision and scale + if normalized_type.startswith("numeric"): + return RustWrenEngineColumnType.NUMERIC + + # Support to Nullable wrapper + if normalized_type.startswith("nullable("): + inner_type = normalized_type[9:-1] + return self._transform_column_type(inner_type) + # Use the module-level mapping table mapped_type = CLICKHOUSE_TYPE_MAPPING.get( normalized_type, RustWrenEngineColumnType.UNKNOWN