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

Christian Beikov commented on CALCITE-1940:
-------------------------------------------

The idea is to encapsulate all the dialect specifics and at the same time 
making the system pluggable. By doing the non-standard unparsing stuff through 
dialect methods, it is possible for consumers of calcite to define a custom 
dialect targeted for their needs. Right now, only sequence fetch rendering is 
handled that way, but I plan to remove all checks against the database product 
of a dialect like e.g. {{dialect.getDatabaseProduct() == 
DatabaseProduct.MYSQL}} that are currently spread around the code base. I'd 
rather have methods that return whether a dialect supports a specific feature 
or handle rendering/unparsing an expression, clause or whole query than checks 
in the main code base that only work for specific database products.
One of the most recent changes of supported features is MySQL since version 8 
will have support for e.g. CTEs. How would the current code handle that? The 
way I am proposing it, the MysqlDialect can self configure during 
instantiation, detect based on the version if a feature is supported and make 
the capability accessible to the code that handles the unparsing.

Apart from that, I'd still need to know how to actually make the planner choose 
the correct plan. Since there is no Jdbc input to the Project node, the query 
isn't rendered with the JdbcConvention. Any idea how I could achieve that?

> Implement dialect specific support for sequences
> ------------------------------------------------
>
>                 Key: CALCITE-1940
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1940
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Christian Beikov
>            Assignee: Julian Hyde
>
> The Calcite parser and validator already supports sequences but the push down 
> to the JDBC level is currently limited. SInce sequences are not supported on 
> all DBMS every sql dialect should have the possibility to render it's own way 
> of extracting sequence information or incrementing the value.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to