You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Data Platform (Jira)" <ji...@apache.org> on 2021/07/30 06:18:00 UTC
[jira] [Created] (CALCITE-4710) In the special scenario of the case
when statement, the constant RexNode fails to be parsed.
Data Platform created CALCITE-4710:
--------------------------------------
Summary: In the special scenario of the case when statement, the constant RexNode fails to be parsed.
Key: CALCITE-4710
URL: https://issues.apache.org/jira/browse/CALCITE-4710
Project: Calcite
Issue Type: Bug
Affects Versions: 1.27.0, 1.20.0
Reporter: Data Platform
I found that calcite had problems parsing the "case when" statement since version 1.20.0.
insert into OutputStream select "zz" as name_a, case when xdr.name_b is not null then "AAAAA" else "BB" end as name_b from InStream as xdr;
----
use calcite (version:1.20.0)to parse the Streamming SQL:
in the "case when" statement, The analysis result is not Correct of RexLiteral "BB":
Result:
Correct: RexLiteral "AAAAA" : type ="CHAR(5)" , digest="'AAAAA'"
Error: RexLiteral "BB" : type ="CHAR(5)" , digest="'BB '"
I found that the parsing result of the constant "BB" is aligned with that of the constant "AAAAA", The missing bits are filled with spaces.
----
use calcite (version:1.17.0)to parse the Streamming SQL:
In the "case when" statement, The analysis result is as expected:
Result:
Correct: RexLiteral "AAAAA" : type ="CHAR(5)" , digest="'AAAAA'"
Correct: RexLiteral "BB" : type ="CHAR(2)" , digest="'BB'"
--
This message was sent by Atlassian Jira
(v8.3.4#803005)