EvgSkv / logica

Logica is a logic programming language that compiles to SQL. It runs on Google BigQuery, PostgreSQL and SQLite.

Home Page:https://logica.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support clickhouse

mgilbir opened this issue · comments

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

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

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.

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

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 :-)