[
https://issues.apache.org/jira/browse/CALCITE-1553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15776302#comment-15776302
]
Baofeng Zhang commented on CALCITE-1553:
----------------------------------------
Thx, I understand how it works now. After I debug into this case, I found that
StandardConvertletTable does the "converPlus" thing to make it a DATETIME_PLUS,
which is computed by RexImplTable in DatetimeArithmeticImplementor, it ignores
YEAR/MONTH/YEAR_MONTH type, but do addMonths anyway.
So the second question is gone either, for ConvertletTable is already exposed.
Please close this issue :)
> Forget to change qualifier when converting INVERVAL_YEAR literal
> ----------------------------------------------------------------
>
> Key: CALCITE-1553
> URL: https://issues.apache.org/jira/browse/CALCITE-1553
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Baofeng Zhang
> Assignee: Julian Hyde
>
> If I execute this SQL:
> {code}SELECT date '2008-12-31' + INTERVAL '1' YEAR{code}
> {{INTERVAL '1' YEAR}} is converted into {{INTERVAL '12' YEAR}} inside
> {{SqlNodeToRexConverterImpl.convertLiteral}} method, which forgets to change
> qualifier to MONTH.
> Besides {{INTERVAL_YEAR_MONTH}}, there maybe other {{SqlTypeFamily}} have the
> same problem.
> In addition, can we expose {{SqlNodeToRexConverter}} in {{SqlToRelConverter}}
> to let developer to plugin their own converter?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)