[ 
https://issues.apache.org/jira/browse/CALCITE-1101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15171506#comment-15171506
 ] 

Rajat Venkatesh commented on CALCITE-1101:
------------------------------------------

I strongly support getting rid of MaterializationService for different reasons. 
The points [~maryannxue] mentioned in the thread are relevant to us but we've 
got past them. It works and doesnt seem as hacky as what Apache Phoenix does.
We are facing issues in multi-threaded scenarios as described in this 
[email|https://mail-archives.apache.org/mod_mbox/calcite-dev/201601.mbox/%3CCANG6QPzArOFjBVEX5USf-r%2BT8BSoA-7_5eSmiv4rkZMPys_r9A%40mail.gmail.com%3E]
 to the dev-list. The map of materialized views should be stored with the 
planner. 
We've also added 
[support|https://github.com/qubole/quark/commit/04b39491e12d1d16e8dd6dcd020bf0a8c2c1d5a7]
 for filters in materialized views. This required changes in calcite. The 
changes mentioned in the description will support that use case. 
So overall, I think the changes are in the right directions but for different 
reasons.

> Extend Schema SPI to provide materialized views
> -----------------------------------------------
>
>                 Key: CALCITE-1101
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1101
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>
> Currently the way to get materialized views is via MaterializationService, 
> but it would be simpler to get them from a new method 
> Schema.getMaterializedViews().
> Some thoughts:
> * The method should return materialized views not just in the current schema, 
> and therefore
> * The method should be filtered by Table (or Tables)
> * The objects returned can not include RelNode (RelNode can only be created 
> in the context of a statement, and the Schema is created before the first 
> statement; furthermore, holding onto RelNode would be a resource leak). But 
> they should provide the means to create a RelNode (given sufficient context).
> * Maybe the objects returned indicate something about the mapping
> Taking all this, we get {code}List<Foo> getMaterializedViews(Table... tables);
> class Foo {
>   public final Table view;
>   public final List<Table> referencedTables;
>   public final TileKey tileKey; // may be null
>   public final String sql; // may be null; for information only
>   public RelNode rel(Context context);
> }
> {code}
> Maybe we can obsolete {{CalciteSchema.getTableBySql}}.
> Cc [~maryannxue], [~jamestaylor].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to