[ https://issues.apache.org/jira/browse/CALCITE-1841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16093708#comment-16093708 ]
Chris Baynes commented on CALCITE-1841: --------------------------------------- I've created a PR for this: https://github.com/apache/calcite/pull/501 During the refactoring I also noticed this issue: https://issues.apache.org/jira/browse/CALCITE-1895 > 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 > > 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)