Skip to content
This repository was archived by the owner on Apr 9, 2026. It is now read-only.

Commit 8514f62

Browse files
committed
fix(bulker): clickhouse: recognize nullable version of UInt8 and other non-string types
1 parent 58d7d82 commit 8514f62

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

bulkerlib/implementations/sql/clickhouse.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,20 @@ var (
7373

7474
clickhouseTypes = map[types.DataType][]string{
7575
types.STRING: {"String", "%String%", "%CHAR%", "%TEXT%", "%BLOB%", "%Enum%", "%UUID%"},
76-
types.INT64: {"Int64", "Int", "LowCardinality(Int"},
77-
types.FLOAT64: {"Float64", "Float32", "Decimal"},
78-
types.TIMESTAMP: {"DateTime64(6)", "DateTime", "Date"},
79-
types.BOOL: {"UInt8"},
76+
types.INT64: {"Int64", "Int%", "LowCardinality(Int%", "Nullable(Int%", "LowCardinality(Nullable(Int%", "%UInt16%", "%UInt32%", "%UInt64%", "%UInt128%", "%UInt256%"},
77+
types.FLOAT64: {"Float64", "Float32", "Decimal%", "Nullable(Float%", "Nullable(Decimal%"},
78+
types.TIMESTAMP: {"DateTime64(6)", "DateTime", "Date", "Nullable(Date%"},
79+
types.BOOL: {"UInt8", "Nullable(UInt8)"},
8080
types.JSON: {"String"},
8181
types.UNKNOWN: {"String"},
8282
}
8383
clickhouseTypesWithJSON = map[types.DataType][]string{
8484
types.STRING: {"String", "%String%", "%CHAR%", "%TEXT%", "%BLOB%", "%Enum%", "%UUID%"},
85-
types.INT64: {"Int64", "Int", "LowCardinality(Int"},
86-
types.FLOAT64: {"Float64", "Float32", "Decimal"},
87-
types.TIMESTAMP: {"DateTime64(6)", "DateTime", "Date"},
88-
types.BOOL: {"UInt8"},
89-
types.JSON: {"JSON", "Array(JSON)"},
85+
types.INT64: {"Int64", "Int%", "LowCardinality(Int%", "Nullable(Int%", "LowCardinality(Nullable(Int%", "%UInt16%", "%UInt32%", "%UInt64%", "%UInt128%", "%UInt256%"},
86+
types.FLOAT64: {"Float64", "Float32", "Decimal%", "Nullable(Float%", "Nullable(Decimal%"},
87+
types.TIMESTAMP: {"DateTime64(6)", "DateTime", "Date", "Nullable(Date%"},
88+
types.BOOL: {"UInt8", "Nullable(UInt8)"},
89+
types.JSON: {"JSON", "Array(JSON)", "Nullable(JSON)", "Nullable(Array(JSON))"},
9090
types.UNKNOWN: {"String"},
9191
}
9292

0 commit comments

Comments
 (0)