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
14 changes: 14 additions & 0 deletions ibis-server/app/model/metadata/clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down