1

I want to setup postgres as a datasource for calcite and make use of calcite's abilities to rewrite queries using materialized views. However, when I try to create a materialized view through calcite I get a postgres error about an insert into relation which doesn't exists.

Upon further inspection, it seems like calcite never creates a materialized view but just translates the query into an "insert into" command and sends it to postgres (which fails because I originally wanted to create this view).

So my question is: how am I supposed to create a materialized view through calcite on postgres?

(I have also asked this question on the mailing list, however it seemed more fitting to post it here)

Mark
  • 11
  • 1

1 Answers1

0

Maybe the solution is defining Lattices when defining schema and letting Calcite create materialized views for you.

When you define materialized view in your schema definition, Calcite just assumes that you already created it in Postgres and that it can use it freely. That's why it makes insert into statement.

igrgurina
  • 50
  • 7