[ https://issues.apache.org/jira/browse/PIG-5389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16877198#comment-16877198 ]
Koji Noguchi commented on PIG-5389: ----------------------------------- Attaching {{pig-5389-v01.patch}} that immediately returns null when null field is passed. Note that UDF was returning null even before this patch except that it was relying on Exception handling when NPE was thrown from inside replaceAll call. {code} 77 try { 78 return mPattern.matcher(source).replaceAll(replacewith); 79 } catch(Exception e){ 80 warn("Replace : Failed to process input; error - " + e.getMessage(), PigWarning.UDF_WARNING_1); 81 return null; 82 } {code} > Passing null to REPLACE udf preventing JIT optimization > ------------------------------------------------------- > > Key: PIG-5389 > URL: https://issues.apache.org/jira/browse/PIG-5389 > Project: Pig > Issue Type: Improvement > Reporter: Koji Noguchi > Assignee: Koji Noguchi > Priority: Trivial > Attachments: pig-5389-v01.patch > > > Saw a case where runtime for tasks varied by 10 times for the same code, same > input, and same node. Turns out Java was indecisive on enabling JIT > optimization for REPLACE/Matcher/regex call path due to repetitive NPE thrown > from inside. -- This message was sent by Atlassian JIRA (v7.6.3#76005)