[ https://issues.apache.org/jira/browse/PIG-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13765123#comment-13765123 ]
Alan Gates commented on PIG-3255: --------------------------------- At compile time, but not at runtime. At runtime Pig would need to reflect the class implementing StreamToPig and see if it contained a deserialize method that matches your new signature. You could then pick which method to call based on that. As Jeremy suggests, you could instead do that with a new interface (PigToStreamV2) and then at compile time determine which interface is being implemented and act accordingly. This is actually better than what I initially suggested as the determination can be made at compile time. If you choose this route you should also change PIgToStreamV2 to an abstract class so that in the future we can add methods without going through this dance. > Avoid extra byte array copy in streaming deserialize > ---------------------------------------------------- > > Key: PIG-3255 > URL: https://issues.apache.org/jira/browse/PIG-3255 > Project: Pig > Issue Type: Bug > Affects Versions: 0.11 > Reporter: Rohini Palaniswamy > Assignee: Rohini Palaniswamy > Fix For: 0.12 > > Attachments: PIG-3255-1.patch, PIG-3255-2.patch, PIG-3255-3.patch > > > PigStreaming.java: > public Tuple deserialize(byte[] bytes) throws IOException { > Text val = new Text(bytes); > return StorageUtil.textToTuple(val, fieldDel); > } > Should remove new Text(bytes) copy and construct the tuple directly from the > bytes -- 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: http://www.atlassian.com/software/jira