Dear Stamatis,
Thank you for your reply.
I have since been trying to create materialized views via calcite without
much success, I don't know if you can perhaps help with that?
I have set up my rootschema as:
final DataSource ds = JdbcSchema.dataSource( dburl, "org.postgresql.Driver"
);
rootSchema.add("DB1", JdbcSchema.create(rootSchema, "DB1", ds, null, null));
Now I have tried multiple times to create a simple materialized view like:
create materialized view v1
create materialized view \"v1\"
create materialized view db1.\"v1\"
But I keep receiving the same exception: org.postgresql.util.PSQLException:
ERROR: relation "DB1.v1" does not exist. I also tried to rename the
"public" schema in postgres to "DB1" in the off chance that their might be
an issue with schema names but that did not work.
Would you perhaps have any idea how to make it work?
Mark
On Mon, 8 Apr 2019 at 12:34, Stamatis Zampetakis <[email protected]> wrote:
> Hi Mark,
>
> I suppose that the views cannot be discovered automatically so you will
> have to register them explicitly. If you are connecting to Postgres using
> the JsonModel then you might find the tests in MaterializationTest [1]
> useful. Most likely you will have to change the SchemaFactory to use the
> one related to JdbcSchema [2].
>
> Best,
> Stamatis
>
> [1]
>
> https://github.com/apache/calcite/blob/16f518b359cdf529d5bbe42cd5e8663001030d14/core/src/test/java/org/apache/calcite/test/MaterializationTest.java#L129
> [2]
>
> https://github.com/apache/calcite/blob/16f518b359cdf529d5bbe42cd5e8663001030d14/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java#L497
>
> On Fri, Apr 5, 2019 at 4:00 PM Mark Pasterkamp <
> [email protected]>
> wrote:
>
> > Dear all,
> >
> > I have connected my postgresql database as a datasource to calcite. I am
> > however not able to find out how I can expose the existing materialized
> > views in postgres to calcite. I am unable to find much help on the
> internet
> > so if anyone is knowledgeable about this I would really appreciate a
> small
> > code example as to how this is supposed to work in Java.
> >
> >
> > Mark
> >
>