Search code examples
prestoclickhouseapache-supersettrino

superset - trino - clickhouse showing data wrongly encoded


We have events data stored in clickhouse DB, for querying and visualization we are using superset and trino being used for query processing and combining data sources.

Beside clickhouse we have postgresql which is working fine, however in clickhouse datasource we are seeing string fields as base64 encoded, when query clickhouse directly using datagrip it works fine but when trying to do via superset -> trino it is encoded.

Any ideas how this could be fixed?

enter image description here

Superset is using trino (sqlalchemy)

enter image description here

and this is how its defined in trino

connector.name=clickhouse
connection-url=jdbc:clickhouse://10.x.x.x:8123/
connection-user=default
connection-password=

Solution

  • Trino has the fields by default considered as varbinary by setting the connection property

    clickhouse.map-string-as-varchar=true
    

    Fixed the mapping issue to use String and FixedStrings

    https://trino.io/docs/current/connector/clickhouse.html

    enter image description here