evidence-dev / evidence

Business intelligence as code: build fast, interactive data visualizations in SQL and markdown
https://evidence.dev
MIT License
4.49k stars 216 forks source link

Clickhouse connection not working - ClickHouse doesn't support extended query mechanism #1647

Open slnw opened 9 months ago

slnw commented 9 months ago

Steps To Reproduce

Source config:

# This file was automatically generated
name: ch
type: postgres
options:
  connectionString: "postgresql://clickhouse:pass@localhost:9005/api?preferQueryMode=simple&sslmode=disable"

The connection works from terminal. Also tried default pgres connection settings which doesn't work. It's a pgres clickhouse interface

Environment

Actual Behaviour

npm run sources

> my-evidence-project@0.0.1 sources
> evidence sources

Processing ch
ClickHouse doesn't support extended query mechanism
archiewood commented 9 months ago

This seems similar to: https://github.com/prestodb/presto/issues/9620

I don't have a Clickhouse instance to test on, so some questions for my benefit:

The connection works from terminal.

using PSQL? using a curl request?

preferQueryMode=simple

what does this do? Can you remove it?

Also tried default pgres connection settings which doesn't work.

if you use the postgres connection settings, what is the error you get, is it the same one?


We may need to implement a standalone Clickhouse connector https://clickhouse.com/docs/en/integrations/language-clients/javascript

slnw commented 9 months ago

@archiewood

I don't have a Clickhouse instance to test on, so some questions for my benefit:

You can run locally with docker compose - https://github.com/ClickHouse/examples/blob/main/docker-compose-recipes/recipes/ch-and-postgres/docker-compose.yaml

using PSQL? using a curl request?

using psql cli

preferQueryMode=simple

yes you can remove it and still doesn't work, it's a try for https://github.com/ClickHouse/ClickHouse/issues/18611#issuecomment-867290109

if you use the postgres connection settings, what is the error you get, is it the same one?

Yes, I used the pgres conn settings.

You might want to remove support for Clickhouse in the docs until it's resolved.

Thank you.

archiewood commented 9 months ago

Good point, thank you for flagging

amit-cashify commented 5 days ago

I am interested in using Clickhouse as a data source. How difficult is it to set up? I am willing to contribute.

archiewood commented 5 days ago

There is now a community plugin I made for clickhouse

https://github.com/archiewood/evidence-connector-clickhouse

Contributions / issues welcome!