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

Joel Costigliola commented on PIG-2881:
---------------------------------------

Hi Cheolsoo,

All tests pass after the regex change, thanks.

To be more precise, I have made a minor refactoring on the TestLoad to avoid 
duplication in checkLoadPath, here's what I've changed :
{code}
if(noConversionExpected) {
    assertEquals(p, expected);
} else  {
    String protocol = pc.getExecType() == ExecType.MAPREDUCE ? "hdfs" : "file";
    // regex : A word character, i.e. [a-zA-Z_0-9] or '-' followed by ':' then 
any characters 
    String regex = "[\\-\\w:\\.]";
    assertTrue(p.matches(".*" + protocol + "://" + regex + "*.*"));
    assertEquals(p.replaceAll(protocol + "://" + regex + "*/", "/"), expected);
}
{code}

If you are ok with that, tell I'll make the patch with SUBTRACT function and 
those changes.

Joel  
                
> Add SUBTRACT eval function
> --------------------------
>
>                 Key: PIG-2881
>                 URL: https://issues.apache.org/jira/browse/PIG-2881
>             Project: Pig
>          Issue Type: New Feature
>          Components: piggybank
>    Affects Versions: 0.10.0
>            Reporter: Joel Costigliola
>            Priority: Minor
>         Attachments: Subtract.java, SubtractTest.java, 
> TEST-org.apache.pig.test.TestLoad.txt, TEST-org.apache.pig.test.TestStore.txt
>
>
> Close to DIFF function but SUBTRACT(bag1, bag2) will subtract elements of 
> bag2 from bag1.
>   

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

Reply via email to