crunch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josh Wills (JIRA)" <>
Subject [jira] [Commented] (CRUNCH-195) NullPointerException when writing PTables created by PTables.asPTable as Avro
Date Tue, 09 Apr 2013 15:14:16 GMT


Josh Wills commented on CRUNCH-195:

I'm not sure this is a bug, although I understand why you want it to work the way that you
do. Right now, we don't have a concept of a union type outside of the optional null values
that are allowed in Tuple objects.
> NullPointerException when writing PTables created by PTables.asPTable as Avro
> -----------------------------------------------------------------------------
>                 Key: CRUNCH-195
>                 URL:
>             Project: Crunch
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.5.0
>            Reporter: Dave Beech
>            Assignee: Josh Wills
> See code fragment below. This is a left join where not all keys match, so some values
on the right-hand side of the Pairs are null.
> ---
> PTable<String,String> a = ...
> PTable<String,String> b = ...
> PTable<String,Pair<String,String>> joined = Join.leftJoin(a, b);
> PCollection<Pair<String, String>> joinedValuesCollection = joined.values();
> joinedValuesCollection.write(To.avroFile("joined-pcol"));
> PTable<String,String> joinedValuesTable = PTables.asPTable(joinedValuesCollection);
> joinedValuesTable.write(To.avroFile("joined-ptable"));
> ---
> The first write to "joined-pcol" works, and the resulting Avro schema is a Pair of type
union ['string','null']. 
> The second write to "joined-ptable" fails with NPE - it appears the String types are
no longer unioned with null and the values are being rejected by the output format. 
> I think this is a bug. The output schema of the PTable should be the same as it was before
it was converted from PCollection<Pair<...>>

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:

View raw message