[
https://issues.apache.org/jira/browse/HIVE-9537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14328992#comment-14328992
]
N Campbell commented on HIVE-9537:
----------------------------------
I saying that if the current implementation is by design and will not change
that it be more completely documented. In particular, to show examples of how
the design may deviate from other systems which implement fixed length
character types as many vendors do (Teradata, DB2, Informix, Netezza, ....).
Unfortunately, the current implementation "feels" like cases where vendors have
added syntax that other products have but the implementation is not the
same/has various gaps. The SQL documentation on the Apache Hive WIKI has
limited discussion on the implementation etc.
As for the last comment: ISO-SQL concatenation CHAR(x) || CHAR(y) should return
CHAR(x+y) with implementation details re what happens when x+y > maximum
precision of CHAR that a vendor provides.
> string expressions on a fixed length character do not preserve trailing spaces
> ------------------------------------------------------------------------------
>
> Key: HIVE-9537
> URL: https://issues.apache.org/jira/browse/HIVE-9537
> Project: Hive
> Issue Type: Bug
> Components: SQL
> Reporter: N Campbell
> Assignee: Aihua Xu
>
> When a string expression such as upper or lower is applied to a fixed length
> column the trailing spaces of the fixed length character are not preserved.
> {code:sql}
> CREATE TABLE if not exists TCHAR (
> RNUM int,
> CCHAR char(32)
> )
> ROW FORMAT DELIMITED
> FIELDS TERMINATED BY '|'
> LINES TERMINATED BY '\n'
> STORED AS TEXTFILE;
> {code}
> {{cchar}} as a {{char(32)}}.
> {code:sql}
> select cchar, concat(cchar, cchar), concat(lower(cchar), cchar),
> concat(upper(cchar), cchar)
> from tchar;
> {code}
> 0|\N
> 1|
> 2|
> 3|BB
> 4|EE
> 5|FF
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)