You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Zhenghua Gao (Jira)" <ji...@apache.org> on 2019/12/10 11:43:00 UTC

[jira] [Closed] (FLINK-9559) The type of a union of CHAR columns of different lengths should be VARCHAR

     [ https://issues.apache.org/jira/browse/FLINK-9559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zhenghua Gao closed FLINK-9559.
-------------------------------
    Resolution: Fixed

> The type of a union of CHAR columns of different lengths should be VARCHAR
> --------------------------------------------------------------------------
>
>                 Key: FLINK-9559
>                 URL: https://issues.apache.org/jira/browse/FLINK-9559
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table SQL / API
>            Reporter: Hequn Cheng
>            Assignee: Zhenghua Gao
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently, If the case-when expression has two branches which return string literal, redundant white spaces will be appended to the short string literal. For example, for the sql: case 1 when 1 then 'a' when 2 then 'bcd' end, the return value will be 'a ' of CHAR(3) instead of 'a'.
> Although, this follows the behavior in strict SQL standard mode(SQL:2003). We should get the pragmatic return type in a real scenario without blank-padded. 
> Happily, this problem has been fixed by [CALCITE-2321|https://issues.apache.org/jira/browse/CALCITE-2321], we can upgrade calcite to the next release(1.17.0) and override {{RelDataTypeSystem}} in flink to configure the return type, i.e., making {{shouldConvertRaggedUnionTypesToVarying()}} return true.



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