Failed to query fields of type FixedString
eye-gu opened this issue · 5 comments
eye-gu commented
com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot access contents of TextNode as binary due to broken Base64 encoding: Unexpected end of base64-encoded String: base64 variant 'MIME-NO-LINEFEEDS' expects padding (one or more '=' characters) at the end. This Base64Variant might have been incorrectly configured
at com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:67)
at com.fasterxml.jackson.databind.node.TextNode.getBinaryValue(TextNode.java:78)
at com.fasterxml.jackson.databind.node.TextNode.binaryValue(TextNode.java:89)
at xenon.clickhouse.read.format.ClickHouseJsonReader.decodeValue(ClickHouseJsonReader.scala:81)
at xenon.clickhouse.read.format.ClickHouseJsonReader.decode(ClickHouseJsonReader.scala:48)
at xenon.clickhouse.read.format.ClickHouseJsonReader.decode(ClickHouseJsonReader.scala:33)
at xenon.clickhouse.read.ClickHouseReader.get(ClickHouseReader.scala:89)
at xenon.clickhouse.read.ClickHouseReader.get(ClickHouseReader.scala:29)
pan3793 commented
Seems like you are storing binary data instead of UTF-8 encoded string using FixedString, mind providing more details about your use case and failed queries?
eye-gu commented
eye-gu commented
I found that in the 'fromClickHouseType' method, the 'FixedString' type is mapped to a 'BinaryType', why is it not a 'StringType'?
pan3793 commented
technically, ClickHouse's FixedString and String are allowed to store any bytes, seems we need to make the type mapping configurable
harryshi10 commented
made a PR for this