You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Rajat Venkatesh <rv...@qubole.com> on 2015/03/27 12:10:48 UTC

MaterializationService.defineMaterialization - trying to understand flow

MaterializationService stores an ArrayTable to represent a materialized
tables by default. Instead, I want it to store an object of MyTable (which
derives from appropriate super classes).
To achieve that, I prepopulated the schema with a TableEntry and viewSql
that it materializes.
Then, I made sure MaterializationService finds it in
https://github.com/apache/incubator-calcite/blob/master/core/src/main/java/org/apache/calcite/materialize/MaterializationService.java#L112

However, the function adds a duplicate entry for the same *viewSql* in:
https://github.com/apache/incubator-calcite/blob/master/core/src/main/java/org/apache/calcite/materialize/MaterializationService.java#L159

Why is it this way ? Should line numbers: 157-161 belong within the *if*
block of line 114 ?


-- 
Rajat Venkatesh | Engg Lead
Qubole Inc | www.qubole.com

Re: MaterializationService.defineMaterialization - trying to understand flow

Posted by Rajat Venkatesh <rv...@qubole.com>.
Thanks. I'll open a jira and work on this.

On Saturday, March 28, 2015, Julian Hyde <ju...@hydromatic.net> wrote:

> > Should line numbers: 157-161 belong within the *if* block of line 114 ?
>
> Probably, yes.
>
> > MaterializationService stores an ArrayTable to represent a materialized
> tables by default. Instead, I want it to store an object of MyTable (which
> derives from appropriate super classes).
>
> I planned to support that scenario at some point. Feel free to
> abstract a "table factory" interface that allows people to create
> table types other than ArrayTable.
>
> We would support user tables both pre-populated (as you are doing) and
> populated on demand. And also populated in the background.
>
>
> On Fri, Mar 27, 2015 at 4:10 AM, Rajat Venkatesh <rvenkatesh@qubole.com
> <javascript:;>> wrote:
> > MaterializationService stores an ArrayTable to represent a materialized
> > tables by default. Instead, I want it to store an object of MyTable
> (which
> > derives from appropriate super classes).
> > To achieve that, I prepopulated the schema with a TableEntry and viewSql
> > that it materializes.
> > Then, I made sure MaterializationService finds it in
> >
> https://github.com/apache/incubator-calcite/blob/master/core/src/main/java/org/apache/calcite/materialize/MaterializationService.java#L112
> >
> > However, the function adds a duplicate entry for the same *viewSql* in:
> >
> https://github.com/apache/incubator-calcite/blob/master/core/src/main/java/org/apache/calcite/materialize/MaterializationService.java#L159
> >
> > Why is it this way ? Should line numbers: 157-161 belong within the *if*
> > block of line 114 ?
> >
> >
> > --
> > Rajat Venkatesh | Engg Lead
> > Qubole Inc | www.qubole.com
>


-- 
Rajat Venkatesh | Engg Lead
Qubole Inc | www.qubole.com

Re: MaterializationService.defineMaterialization - trying to understand flow

Posted by Julian Hyde <ju...@hydromatic.net>.
> Should line numbers: 157-161 belong within the *if* block of line 114 ?

Probably, yes.

> MaterializationService stores an ArrayTable to represent a materialized tables by default. Instead, I want it to store an object of MyTable (which derives from appropriate super classes).

I planned to support that scenario at some point. Feel free to
abstract a "table factory" interface that allows people to create
table types other than ArrayTable.

We would support user tables both pre-populated (as you are doing) and
populated on demand. And also populated in the background.


On Fri, Mar 27, 2015 at 4:10 AM, Rajat Venkatesh <rv...@qubole.com> wrote:
> MaterializationService stores an ArrayTable to represent a materialized
> tables by default. Instead, I want it to store an object of MyTable (which
> derives from appropriate super classes).
> To achieve that, I prepopulated the schema with a TableEntry and viewSql
> that it materializes.
> Then, I made sure MaterializationService finds it in
> https://github.com/apache/incubator-calcite/blob/master/core/src/main/java/org/apache/calcite/materialize/MaterializationService.java#L112
>
> However, the function adds a duplicate entry for the same *viewSql* in:
> https://github.com/apache/incubator-calcite/blob/master/core/src/main/java/org/apache/calcite/materialize/MaterializationService.java#L159
>
> Why is it this way ? Should line numbers: 157-161 belong within the *if*
> block of line 114 ?
>
>
> --
> Rajat Venkatesh | Engg Lead
> Qubole Inc | www.qubole.com