You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2018/09/11 21:29:00 UTC

[jira] [Resolved] (HIVE-20520) length(CHAR) doesn't consider trailing space

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

Jesus Camacho Rodriguez resolved HIVE-20520.
--------------------------------------------
    Resolution: Won't Fix

I was too quick to push the patch. Behavior is consistent with other RDBMS such MySQL and Postgres (though not with Oracle), hence there is no reason to change Hive behavior now. I have reverted it.

> length(CHAR) doesn't consider trailing space
> --------------------------------------------
>
>                 Key: HIVE-20520
>                 URL: https://issues.apache.org/jira/browse/HIVE-20520
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>            Reporter: Naresh P R
>            Assignee: Jesus Camacho Rodriguez
>            Priority: Major
>             Fix For: 4.0.0, 3.2.0
>
>         Attachments: HIVE-20520.01.patch, HIVE-20520.02.patch, HIVE-20520.02.patch, HIVE-20520.02.patch, HIVE-20520.patch
>
>
> Reproduce steps:
> {code:java}
> create table test(a char(2), b varchar(2));
> insert into test values('L ', 'L ');
> select length(a),length(b) from test;
> +------+------+
> | _c0  | _c1  |
> +------+------+
> | 1    | 2    |
> +------+------+
> 1 row selected (0.185 seconds)
> {code}
> Here char with trailing spaces are trimmed, whereas leading spaces are not trimmed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)