Skip to content

Commit

Permalink
Temporarily patch converters to fix support for LowCardinality strings
Browse files Browse the repository at this point in the history
  • Loading branch information
adamyeats committed Jul 9, 2024
1 parent 55e38ad commit 48b50a2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/converters/converters.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,17 @@ var Converters = map[string]Converter{
matchRegex: matchRegexes["Point"],
scanType: reflect.TypeOf((*interface{})(nil)).Elem(),
},
// This is a temporary solution to handle LowCardinality types.
// We'll need to add support for LowCardinality types to `sqlutil` package.
"LowCardinality(String)": {
fieldType: data.FieldTypeString,
scanType: reflect.PointerTo(reflect.TypeOf("")),
},
"LowCardinality(Nullable(String))": {
fieldType: data.FieldTypeNullableString,
matchRegex: matchRegexes["LowCardinality()"],
scanType: reflect.PointerTo(reflect.PointerTo(reflect.TypeOf(""))),
},
}

var ClickhouseConverters = ClickHouseConverters()
Expand Down

0 comments on commit 48b50a2

Please sign in to comment.