You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Junjie Chen (JIRA)" <ji...@apache.org> on 2017/09/25 08:06:00 UTC

[jira] [Commented] (HIVE-17593) DataWritableWriter strip spaces for CHAR type before writing, but predicate generator doesn't do same thing.

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

Junjie Chen commented on HIVE-17593:
------------------------------------

hive strip spaces for char(lengh) type,  and then store value to parquet.  Other parquet reader may read striped value which is different from original.

   public void write(Object value) {
      String v = inspector.getPrimitiveJavaObject(value).getStrippedValue();
      recordConsumer.addBinary(Binary.fromString(v));
    }

[~Ferd], do you think this is a valid case? Shouldn't it store the real value? 

> DataWritableWriter strip spaces for CHAR type before writing, but predicate generator doesn't do same thing.
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-17593
>                 URL: https://issues.apache.org/jira/browse/HIVE-17593
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 3.0.0
>            Reporter: Junjie Chen
>
> DataWritableWriter strip spaces for CHAR type before writing. While when generating predicate, it does NOT do same striping which should cause data missing!
> In current version, it doesn't cause data missing since predicate is not well push down to parquet due to HIVE-17261.
> Please see ConvertAstTosearchArg.java, getTypes treats CHAR and STRING as same which will build a predicate with tail spaces.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)