crunch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Micah Whitacre (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CRUNCH-239) Add support for unions of PTypes
Date Wed, 08 Jan 2014 02:56:51 GMT

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

Micah Whitacre commented on CRUNCH-239:
---------------------------------------

Thanks for the patch I kept trying to make it fit into Java Generics and kept failing.  This
approach looks good.

Shouldn't the UnionTuple.size(); method always return 1?  Looking through the patch only location
I see it being used is doing an IAE check in getValue(int) method.  While tracking the info
is nice it doesn't really honor the size() javadoc on the Tuple API.

The other question is what is the value in implementing Tuple?  I would assume that for most
consumers they'd use the getValue() method (and rarely getIndex()).  In that case they most
likely won't be using getValue(int) and size() so is there value in implementing them?


> Add support for unions of PTypes
> --------------------------------
>
>                 Key: CRUNCH-239
>                 URL: https://issues.apache.org/jira/browse/CRUNCH-239
>             Project: Crunch
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Josh Wills
>            Assignee: Josh Wills
>         Attachments: CRUNCH-239.patch
>
>
> There are a few core use cases (e.g., cogroups, as in CRUNCH-174) where it would be useful
to construct a union of multiple PTypes into a single PType, where any given observation could
only be of one of multiple/optional types.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message