You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@crunch.apache.org by "Micah Whitacre (JIRA)" <ji...@apache.org> on 2014/01/08 03:56:51 UTC

[jira] [Commented] (CRUNCH-239) Add support for unions of PTypes

    [ 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)