You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2017/07/27 17:45:00 UTC

[jira] [Resolved] (CALCITE-1841) Create handlers for Jdbc dialect specific generated sql

     [ https://issues.apache.org/jira/browse/CALCITE-1841?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Hyde resolved CALCITE-1841.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 1.14.0

Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/bdaa33f9. Thanks for the PR, [~chris-baynes]!

> Create handlers for Jdbc dialect specific generated sql
> -------------------------------------------------------
>
>                 Key: CALCITE-1841
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1841
>             Project: Calcite
>          Issue Type: Improvement
>          Components: jdbc-adapter
>            Reporter: Chris Baynes
>            Assignee: Julian Hyde
>             Fix For: 1.14.0
>
>
> Currently the only way to generate different sql for dialects is to switch on the dialect in the unparse method. This is used quite heavily in e.g. SqlFloorFunction, but there are also switches in:
> * SUBSTRING()
> * SqlDateLiteral quoting
> * SqlTimestampLiteral quoting
> * Dialects using different interval literals (e.g. Hsqldb uses YYYY & MM rather than YEAR & MONTH)
> * limit/offset construction
> * mysql isnull function
> * type differences (*)
> It would be great to have dialect specific handlers to deal with these, making testing & addition of new handlers (new dialects, or new overrides for a given function) much easier in the future.
> One suggested path to approach this: https://issues.apache.org/jira/browse/CALCITE-1798?focusedCommentId=16031609&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16031609
> (*) There is a comment in SqlImplementor that reads "MySQL doesn't have a VARCHAR type, only CHAR.". Not sure if this was for a very old version of mysql, but it's certainly not true anymore.



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