[
https://issues.apache.org/jira/browse/PIG-613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12837479#action_12837479
]
Richard Ding commented on PIG-613:
----------------------------------
The patch looks good. A few comments:
* File TestTextDataParser.java should be removed.
* In LoadCaster, javadoc is needed for the new parameters.
* In Utf8StorageConverter's bytesToTuple method, the cast to Tuple can be
removed. Same for the cast in bytesToBag and bytesToMap. In consumeBag method,
use consumeTuple instead of consumeComplexType to be more precise. In
bytesToBoolean method, use Boolean.valueof to be consistent with other existing
methods. Also should the new helper methods consume{Bag, Tuple, Map} be
private (not public)?
* The new methods added in impl.util.Utils class should be added to a
test.util class since they are only used in the unit tests.
I maybe too picky here, but I would like to see more consistent coding style
across files. For example,
* Use 4 spaces (not tab) for indentation: tabs are used in ResourceSchema.
POCast, and TypeCheckingVisitor.
> Casting elements inside a tuple does not take effect
> ----------------------------------------------------
>
> Key: PIG-613
> URL: https://issues.apache.org/jira/browse/PIG-613
> Project: Pig
> Issue Type: Bug
> Components: impl
> Affects Versions: 0.2.0
> Reporter: Viraj Bhat
> Assignee: Daniel Dai
> Fix For: 0.7.0
>
> Attachments: myfloatdata.txt, PIG-613-1.patch, SQUARE.java
>
>
> Consider the following Pig script which casts return values of the SQUARE UDF
> which are tuples of doubles to long. The describe output of B shows it is
> long, however the result is still double.
> {code}
> register statistics.jar;
> A = load 'myfloatdata.txt' using PigStorage() as (doublecol:double);
> B = foreach A generate (tuple(long))statistics.SQUARE(doublecol) as
> squares:(loadtimesq);
> describe B;
> explain B;
> dump B;
> {code}
> ===========================================
> Describe output of B:
> B: {squares: (loadtimesq: long)}
> ===========================================================
> Sample output of B:
> ((7885.44))
> ((792098.2200010001))
> ((1497360.9268889998))
> ((50023.7956))
> ((0.972196))
> ((0.30980356))
> ((9.9760144E-7))
> ===========================================================
> Cause: The cast for Tuples has not been implemented in POCast.java
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.