[ https://issues.apache.org/jira/browse/IMPALA-6313?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tim Armstrong resolved IMPALA-6313. ----------------------------------- Resolution: Duplicate Looks like we already are tracking this. I'm not sure what the use-case is but my suggestion would be to use STRING or VARCHAR in preference to CHAR. Even without this bug, the correct behaviour of CHAR is often counter-intuitive because of the rules about when the padding spaces are added and removed. > length function returns incorrect value when input is a cast of a string > literal > -------------------------------------------------------------------------------- > > Key: IMPALA-6313 > URL: https://issues.apache.org/jira/browse/IMPALA-6313 > Project: IMPALA > Issue Type: Bug > Components: Backend > Affects Versions: Impala 2.9.0, Impala 2.11.0 > Reporter: N Campbell > Priority: Critical > Labels: correctness > > The following expressions return a value of 32 > {noformat} > select length( concat( cast ( 'a' as char(32) ), '' ) ) from cert.tversion > select length( 'a ') from cert.tversion > {noformat} > This expression returns a value of 1 and not 32 > {noformat} > select length( cast ( 'a' as char(32) ) ) from cert.tversion > {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029)