You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jinfeng Ni (JIRA)" <ji...@apache.org> on 2015/10/06 08:39:26 UTC

[jira] [Comment Edited] (CALCITE-911) Make CalciteSchema extendible for different implementation.

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

Jinfeng Ni edited comment on CALCITE-911 at 10/6/15 6:38 AM:
-------------------------------------------------------------

I submit PR at: https://github.com/apache/incubator-calcite/pull/142

It contains two commits. The first one is the original one made by Jacques in Drill's forked Calcite. I did some refactoring work in the second commit, such that 1) CalciteSchema becomes an interface, 2) CalciteAbstractSchema contains the implementation for either caching version or non-caching version, 3) The origianl caching version extends from CalciteAbstractSchema and is put into CalciteSchemaImpl.

I removed SimpleCalciteSchema in Jacques's commit. I intended to put it in Drill's code by extending from CalciteAbstractSchema, as I think different system should be able to provide different implementation of CalciteSchema interface itself, if it wants a different behavior than the default CalciteSchemaImpl one. 

If the above logic makes sense, then it seems reasonable for each system to add test for different implementation and Calcite should only have test for the default one : CalciteSchemaImpl.

[~jnadeau] and [~julianhyde], could you please take a look at the PR?




was (Author: jni):
I submit PR at: https://github.com/apache/incubator-calcite/pull/142

It contains two commits. The first one is the original one made by Jacques in Drill's forked Calcite. I did some refactoring work in the second commit, such that 1) CalciteSchema becomes an interface, 2) CalciteAbstractSchema contains the implementation for either caching version or non-caching version, 3) The origianl caching version extends from CalciteAbstractSchema and is put into CalciteSchemaImpl.

I removed SimpleCalciteSchema in Jacques's commit. I intended to put it in Drill's code by extending from CalciteAbstractSchema, as I think different system should be able to provide different implementation of CalciteSchema interface itself, it it wants a different behavior than the default CalciteSchemaImpl one. 

If the above logic makes sense, then it seems reasonable for each system to add test for different implementation and Calcite should only have test for the default one : CalciteSchemaImpl.

[~jnadeau] and [~julianhyde], could you please take a look at the PR?



> Make CalciteSchema extendible for different implementation.
> -----------------------------------------------------------
>
>                 Key: CALCITE-911
>                 URL: https://issues.apache.org/jira/browse/CALCITE-911
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Jinfeng Ni
>            Assignee: Jinfeng Ni
>
> CalciteSchema by default uses cache to store table, sub-schema, function. This would work perfectly for schema-based system, yet would create problem for Drill, which dynamically explore the schema on the fly during query execution. 
> One solution is to refactor CalciteSchema and make it as an interface. The default implementation would still use the current implementation. Further, it would other system to extend the default behavior and make CalciteSchema works for Drill as well. 
> Background information: The issue around CalciteSchema is one of the reasons that Drill has to use a forked version of Calcite. Hopefully, if we could resolve this issue, we are one step further to remove the forked Calcite in the near future.
>  



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