[ 
https://issues.apache.org/jira/browse/PIG-1896?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alan Gates updated PIG-1896:
----------------------------

    Attachment: PIG-1896.patch

Rather than attach patches inline, please attach them as separate files.  I've 
taken your changes and made them into a patch file and attached it.  Please see 
http://wiki.apache.org/pig/HowToContribute for complete details on how this can 
be done.

I did make one change in your patch, I changed the function name from 'convert' 
to 'stringToObject'.  Before we can commit it, you will need to add some unit 
tests.  Just a check that the each value type converts properly and that values 
that don't make any sense come back properly as nulls.

One question overall.  This looks very similar to the bytesTo methods in 
Utf8StorageConverter.  Would those serve your purpose?


> CastUtils - Converting Pig DataTypes to Java Data Types
> -------------------------------------------------------
>
>                 Key: PIG-1896
>                 URL: https://issues.apache.org/jira/browse/PIG-1896
>             Project: Pig
>          Issue Type: Improvement
>          Components: impl
>    Affects Versions: 0.8.0
>            Reporter: Jonathan Holloway
>            Priority: Minor
>         Attachments: PIG-1896.patch, pigcastutils.patch
>
>
> I ran into an issue with parsing log lines whereby I had to generate a schema 
> in a user defined function.  Part of that involved converting various values 
> into their associated data types, but I couldn't see a way to do it via Pig.  
> Enclosed is a patch to convert org.apache.pig.data.DataType into an 
> associated Java datatype falling back to a String by default - should go into 
> CastUtils.  Any comments/criticism, please let me know.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to