diff --git a/src/main/kotlin/com/ecwid/clickhouse/Types.kt b/src/main/kotlin/com/ecwid/clickhouse/Types.kt index b79357d..3f60e44 100644 --- a/src/main/kotlin/com/ecwid/clickhouse/Types.kt +++ b/src/main/kotlin/com/ecwid/clickhouse/Types.kt @@ -67,6 +67,8 @@ internal fun parseType(type: String): Type { parseArrayType(type) } else if (type.startsWith("Map(")) { parseMapType(type) + } else if (type.startsWith("LowCardinality(")) { + parseLowCardinalityType(type) } else { parsePlatformType(type) } @@ -113,6 +115,12 @@ private fun parsePlatformType(type: String): Type { return Type.Platform(platformType, type) } +private fun parseLowCardinalityType(type: String): Type { + val platformTypeName = type.removeSurrounding(prefix = "LowCardinality(", suffix = ")") + val platformType = findPlatformType(platformTypeName) + return Type.Platform(platformType, type) +} + private fun parseArrayType(type: String): Type { val platformTypeName = type.removeSurrounding("Array(", ")") val platformType = findPlatformType(platformTypeName)