EvgSkv / logica

Logica is a logic programming language that compiles to SQL. It runs on DuckDB, Google BigQuery, PostgreSQL and SQLite.
https://logica.dev
Apache License 2.0
1.77k stars 93 forks source link

Support clickhouse #75

Open mgilbir opened 3 years ago

mgilbir commented 3 years ago

Clickhouse is a columnar store that can be queried with SQL.

knoguchi commented 3 years ago

It's interesting idea but Logica uses UDFs (user defined functions) which ClickHouse doesn't support at this moment.
The ClickHouse roadmap for 2021 hinted they are considering UDF as executable script over pipe. I think we can take advantage of this feature when it's ready.

https://presentations.clickhouse.tech/percona2021/#27

EvgSkv commented 3 years ago

Logica compiles to UDFs only predicates defined with --> notation. It's not a huge burgen on the user willing to use Clickhouse not to use such notation. Furthermore, it's not too hard to turn off UDF compilation based on the engine. So I don't think this limitation is substantial.

knoguchi commented 2 years ago

Recent ClickHouse added UDF. We may be able to use the new functionality while I understand UDF is not a substantial limitation.

EvgSkv commented 2 years ago

Yeah, that's right, UDFs were not a limitation. I didn't work with Clickhouse, so I don't know what would be challenges. Biggest challenge with full support of Postgres is that you can't use structs without defining their types. And Logic relies on records quite a bit. I don't know if this would be applicable to Clickhouse. I'm happy to help with understanding Logica compiler to whomever wants to work on this :-)