You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "baofeng.zbf" <ba...@alibaba-inc.com> on 2016/12/23 03:28:17 UTC
Bug on convert INTERVAL_YEAR literal
Hi,
Found a bug on parse "SELECT date '2008-12-31' + INTERVAL '1' YEAR” to SqlNode,
for the INTERVAL ‘1’ YEAR is converted to INTERVAL ‘12’ YEAR in SqlNodeToRexConverterImpl:
Inside convertLiteral method, the value is multiplied by 12 to month, but qualifier is still YEAR, forget to change to MONTH.
Thx,
Baofeng Zhang
Re: Bug on convert INTERVAL_YEAR literal
Posted by Julian Hyde <jh...@apache.org>.
Thanks for creating the case. Now that I've run a test case, I'm now
not so sure that it is a bug. Let's discuss in
https://issues.apache.org/jira/browse/CALCITE-1553.
On Fri, Dec 23, 2016 at 2:03 AM, baofeng.zbf
<ba...@alibaba-inc.com> wrote:
> JIRA created here: https://issues.apache.org/jira/browse/CALCITE-1553
>
> Thx,
> Baofeng Zhang
>
>> 在 2016年12月23日,下午5:13,Julian Hyde <jh...@apache.org> 写道:
>>
>> That sounds like a bug. Can you please log a JIRA case with a test case?
>>
>>> On Dec 22, 2016, at 7:28 PM, baofeng.zbf <ba...@alibaba-inc.com> wrote:
>>>
>>>
>>> Hi,
>>>
>>> Found a bug on parse "SELECT date '2008-12-31' + INTERVAL '1' YEAR” to SqlNode,
>>>
>>> for the INTERVAL ‘1’ YEAR is converted to INTERVAL ‘12’ YEAR in SqlNodeToRexConverterImpl:
>>>
>>> Inside convertLiteral method, the value is multiplied by 12 to month, but qualifier is still YEAR, forget to change to MONTH.
>>>
>>> Thx,
>>> Baofeng Zhang
>>
>
Re: Bug on convert INTERVAL_YEAR literal
Posted by "baofeng.zbf" <ba...@alibaba-inc.com>.
JIRA created here: https://issues.apache.org/jira/browse/CALCITE-1553
Thx,
Baofeng Zhang
> 在 2016年12月23日,下午5:13,Julian Hyde <jh...@apache.org> 写道:
>
> That sounds like a bug. Can you please log a JIRA case with a test case?
>
>> On Dec 22, 2016, at 7:28 PM, baofeng.zbf <ba...@alibaba-inc.com> wrote:
>>
>>
>> Hi,
>>
>> Found a bug on parse "SELECT date '2008-12-31' + INTERVAL '1' YEAR” to SqlNode,
>>
>> for the INTERVAL ‘1’ YEAR is converted to INTERVAL ‘12’ YEAR in SqlNodeToRexConverterImpl:
>>
>> Inside convertLiteral method, the value is multiplied by 12 to month, but qualifier is still YEAR, forget to change to MONTH.
>>
>> Thx,
>> Baofeng Zhang
>
Re: Bug on convert INTERVAL_YEAR literal
Posted by Julian Hyde <jh...@apache.org>.
That sounds like a bug. Can you please log a JIRA case with a test case?
> On Dec 22, 2016, at 7:28 PM, baofeng.zbf <ba...@alibaba-inc.com> wrote:
>
>
> Hi,
>
> Found a bug on parse "SELECT date '2008-12-31' + INTERVAL '1' YEAR” to SqlNode,
>
> for the INTERVAL ‘1’ YEAR is converted to INTERVAL ‘12’ YEAR in SqlNodeToRexConverterImpl:
>
> Inside convertLiteral method, the value is multiplied by 12 to month, but qualifier is still YEAR, forget to change to MONTH.
>
> Thx,
> Baofeng Zhang