You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Benchao Li (Jira)" <ji...@apache.org> on 2020/04/15 08:26:00 UTC

[jira] [Commented] (FLINK-17153) flink sql convert constant to char type cause loop

    [ https://issues.apache.org/jira/browse/FLINK-17153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17083905#comment-17083905 ] 

Benchao Li commented on FLINK-17153:
------------------------------------

[~xiaodao] thanks for reporting the bug, the community is already aware of this bug [1].

And it has been fixed in 1.10 and master branch, we'll fix it for branch-1.9 recently.

 

 [1] https://issues.apache.org/jira/browse/FLINK-16113

> flink sql convert constant to char type cause loop 
> ---------------------------------------------------
>
>                 Key: FLINK-17153
>                 URL: https://issues.apache.org/jira/browse/FLINK-17153
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>    Affects Versions: 1.9.1
>            Reporter: xiaodao
>            Priority: Major
>
> sql:
> SELECT
>  '公开发债' AS secondary_business
> FROM VarBondCode
> WHERE stock_type = '77';
> code is:
> org.apache.flink.table.planner.codegen.CodeGeneratorContext#addReusableStringConstants
> when it parse constant, it change to unicode, and str length is change, in this case secondary_business is char(4), and after  change it become '_UTF-16LE'\u516C\u5F00\u53D1\u503A''.
> calcite call makecast func can't remove it,and call it loop;
> org.apache.calcite.rex.RexBuilder#canRemoveCastFromLiteral
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)