You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Hongze Zhang (JIRA)" <ji...@apache.org> on 2019/03/30 08:54:00 UTC
[jira] [Commented] (CALCITE-2866) Allow passing factory of
SqlValidator / SqlToRelConverter / CatalogReader into FrameworkConfig
[ https://issues.apache.org/jira/browse/CALCITE-2866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16805720#comment-16805720 ]
Hongze Zhang commented on CALCITE-2866:
---------------------------------------
[~julianhyde] - I have started some initial work on fixing this. Now I'm wondering that it might not be a good idea to change {{CalciteConnectionConfig}}. Making these tools configurable via JDBC seems to be attractive for developers but it brings more complexity. So now I am intend to pass the factories using {{Context.of(...)}}.
But I think it could also be better to add some fields directly to {{FrameworkConfig}} instead of using context. It does change the API but since we use builder pattern on the config class we don't need to add more constructors to keep backward compatibility.
Any suggestions?
> Allow passing factory of SqlValidator / SqlToRelConverter / CatalogReader into FrameworkConfig
> -----------------------------------------------------------------------------------------------
>
> Key: CALCITE-2866
> URL: https://issues.apache.org/jira/browse/CALCITE-2866
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Hongze Zhang
> Assignee: Hongze Zhang
> Priority: Major
> Labels: usability
>
> It seems that the customization of SqlValidator / SqlToRelConverter / CatalogReader in downstream projects is normal.
> E.g. Following are some examples (not all) of extended SqlValidator / SqlToRelConverter / CatalogReader from other projects that are using Calcite as query planner :
> # DrillValidator
> [https://github.com/apache/drill/blob/4627973bde9847a4eb2672c44941136c167326a1/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/SqlConverter.java#L249]
> # FlinkCalciteSqlValidator
> [https://github.com/apache/flink/blob/master/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/calcite/FlinkCalciteSqlValidator.scala#L31]
> # DremioSqlToRelConverter
> [https://github.com/dremio/dremio-oss/blob/master/sabot/kernel/src/main/java/com/dremio/exec/planner/sql/DremioSqlToRelConverter.java#L40]
> # (Dremio) SqlValidatorImpl
> [https://github.com/dremio/dremio-oss/blob/master/sabot/kernel/src/main/java/com/dremio/exec/planner/sql/SqlValidatorImpl.java#L32]
> # DremioCatalogReader
> [https://github.com/dremio/dremio-oss/blob/master/sabot/kernel/src/main/java/com/dremio/exec/catalog/DremioCatalogReader.java#L71]
> The class tools/Planner.java[1] is a good customization tool for Calcite user. However currently there are no way to use Frameworks.getPlanner() directly if the classes need to be customized[2][3].
>
> [1] [https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/tools/Planner.java]
> [2] [https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java#L232]
> [3] [https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java#L184]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)