Hi Contributors,

I have recently started to experiment with Apache Calcite's materialized
views and I needed a bit of help.

I have explicitly defined materialized views which are stored in data
source by defining it in root.schema.materializations of model file.

Now for a query which should use the Materialized View:

Explain plan for "query" gives a plan which shows that the MV is being
utilized.

However, I wanted the optimized rewrite SQL query if possible, not just the
plan. So far, I tried to use the rel2sql api but when I print
RelNode.toString(), it gives me a plan which involves scanning the raw
tables and hence the SQL generated by rel2sql is not the one which utilized
the materialized view. Any pointers to get the rewrite query.

-- 
Thanks & Regards

Shubham Kumar

Reply via email to