crunch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabriel Reid (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CRUNCH-302) PType OutputMapFn not initialised when using MemPipeline
Date Thu, 21 Nov 2013 20:00:36 GMT

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

Gabriel Reid commented on CRUNCH-302:
-------------------------------------

Yeah, I guess it's related to those, but I'm thinking that this should be as simple as calling
collection.getPType().initialize() in MemPipeline.write, right?

> PType OutputMapFn not initialised when using MemPipeline
> --------------------------------------------------------
>
>                 Key: CRUNCH-302
>                 URL: https://issues.apache.org/jira/browse/CRUNCH-302
>             Project: Crunch
>          Issue Type: Bug
>          Components: Core, IO
>    Affects Versions: 0.9.0
>         Environment: Crunch synced to 2aa692e5299ee9d775218d4754ae73f3d58beed1
> java version "1.6.0_65"
> Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
> Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
>            Reporter: Christophe Van Gysel
>            Assignee: Josh Wills
>            Priority: Minor
>
> It seems that the OutputMapFns for PTypes aren't initialised when running in local memory.
For most types this doesn't matter, but it gets tricky when using a Tuple as a key or value
type in a PTable or a PCollection of Tuples; the following exception gets thrown:
> Caused by: java.lang.NullPointerException
> 	at org.apache.crunch.types.writable.Writables$TupleTWMapFn.map(Writables.java:376)
> 	at org.apache.crunch.types.writable.Writables$TupleTWMapFn.map(Writables.java:337)
> 	at org.apache.crunch.impl.mem.MemPipeline.writeSequenceFileFromPTable(MemPipeline.java:270)
> 	at org.apache.crunch.impl.mem.MemPipeline.write(MemPipeline.java:196)
> 	at org.apache.crunch.impl.mem.MemPipeline.write(MemPipeline.java:177)
> I'm currently working around this issue by explicitly calling the initialize() method
on MapFn, like this:
> table.getPTableType().getValueType().getOutputMapFn().initialize();



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message