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

Travis Crawford commented on HIVE-3323:
---------------------------------------

Summary of what this feature enables:

{code}
hive> create table convert_enum_to_string
    >   partitioned by (b string)
    >   row format serde 
"org.apache.hadoop.hive.serde2.thrift.ThriftDeserializer"
    >     with serdeproperties (
    >       
"serialization.class"="org.apache.hadoop.hive.serde2.thrift.test.Complex",
    >       
"serialization.format"="org.apache.thrift.protocol.TBinaryProtocol");
OK
Time taken: 0.067 seconds
hive> set hive.data.convert.enum.to.string=true;
hive> describe convert_enum_to_string;
OK
aint    int     from deserializer
astring string  from deserializer
lint    array<int>      from deserializer
lstring array<string>   from deserializer
lintstring      array<struct<myint:int,mystring:string,underscore_int:int>>     
from deserializer
mstringstring   map<string,string>      from deserializer
myenum  string  from deserializer
b       string  
Time taken: 0.349 seconds
hive> set hive.data.convert.enum.to.string=false;
hive> describe convert_enum_to_string;
OK
aint    int     from deserializer
astring string  from deserializer
lint    array<int>      from deserializer
lstring array<string>   from deserializer
lintstring      array<struct<myint:int,mystring:string,underscore_int:int>>     
from deserializer
mstringstring   map<string,string>      from deserializer
myenum  struct<value:int>       from deserializer
b       string  
Time taken: 0.144 seconds
{code}
                
> Enable enum to string conversions
> ---------------------------------
>
>                 Key: HIVE-3323
>                 URL: https://issues.apache.org/jira/browse/HIVE-3323
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Travis Crawford
>            Assignee: Travis Crawford
>         Attachments: HIVE-3323_enum_to_string.1.patch, 
> HIVE-3323_enum_to_string.2.patch
>
>
> When using serde-reported schemas with the ThriftDeserializer, Enum fields 
> are presented as {{struct<value:int>}}
> Many users expect to work with the string values, which is both easier and 
> more meaningful as the string value communicates what is represented.
> Hive should provide a mechanism to optionally convert enum values to strings.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to