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

Hongze Zhang commented on CALCITE-3093:
---------------------------------------

Thanks for the thoughtful ideas, [~julianhyde]. (and sorry for the typo :))

To address your suggestion I'll continue to separate the issue to this one and 
another - for adding system properties and fixing PlannerImpl respectively. I 
see you suggested to have two commits, I suppose we need independent JIRA 
tickets for each, so correct me if I am wrong.

Also I agree that the JDBC connections to Calcite are lightweight. To be honest 
I can't tell immediately how we can gain from such changes to PlannerImpl. But 
from my perspective it makes the call chain to Calcite internal clearer than 
before. And let's consider a bit further - do we have a chance to create a 
individual maven module for Calcite JDBC driver (maybe named as 
calcite-jdbc-driver or something, to distinguish with the Calcite JDBC 
adapter)? Say, if users want to simply use Calcite to query their own data 
source, they can import both calcite-jdbc-driver and calcite-core in his code. 
If only the Planner API is needed, then the importing of calcite-jdbc-driver 
can be eliminated. Just a thought.

> Remove JDBC connection calls from PlannerImpl
> ---------------------------------------------
>
>                 Key: CALCITE-3093
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3093
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Hongze Zhang
>            Assignee: Hongze Zhang
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently the class {{PlannerImpl}} creates JDBC connections[1] internally to 
> instantiate {{RelOptPlanner}}. For improving the design I suggest to reverse 
> the call chain, for example, we can make JDBC API call PlannerImpl to create 
> {{RelOptPlanner}}, {{SqlValidator}}, {{SqlToRelConverter}} instances, etc.
> This JIRA topic is the first step of the improvement - we should decouple the 
> use of JDBC API from PlannerImpl. Planner API is designed to be a reusable 
> toolkit and we should make it work individually without the help of JDBC API.
> [1] 
> https://github.com/apache/calcite/blob/4e1b68e3c0b2a90832cc790c6166cebb14ae2970/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java#L143-L151



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to