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

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

Hey all, good discussion about this enum issue. After thinking about the 
comments, I think it would be appropriate to always convert enum values to 
strings, as the Avro serde does.

Here's why:

* Native Hive queries: enums-as-strings make the most sense
* Pig queries through HCat: enums-as-strings make the most sense
* MR jobs through HCat: enums-as-strings are reasonable, and if users actually 
want the int value they can convert in their code.

Since enums-as-strings makes sense for scripting languages, and users do not 
loose functionality in MR jobs, I think it makes sense to always convert enums 
to strings.

Thoughts? If this sounds good I can update the patch.
                
> ThriftSerde: Enable enum to string conversions
> ----------------------------------------------
>
>                 Key: HIVE-3323
>                 URL: https://issues.apache.org/jira/browse/HIVE-3323
>             Project: Hive
>          Issue Type: Improvement
>    Affects Versions: 0.10.0
>            Reporter: Travis Crawford
>            Assignee: Travis Crawford
>         Attachments: HIVE-3323_enum_to_string.1.patch, 
> HIVE-3323_enum_to_string.2.patch, HIVE-3323_enum_to_string.3.patch, 
> HIVE-3323_enum_to_string.4.patch, HIVE-3323_enum_to_string.5.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
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to