You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "songwanging (JIRA)" <ji...@apache.org> on 2015/07/26 22:58:05 UTC

[jira] [Created] (PIG-4642) Function call error, when comparing two instances of class "Tuple", should use "compareTuple()", while in current version the method "compare()" compares two instances of "Tuple" using itself: "compare()", which introduces a recursion error.

songwanging created PIG-4642:
--------------------------------

             Summary: Function call error, when comparing two instances of class "Tuple", should use "compareTuple()", while in current version the method "compare()" compares two instances of "Tuple" using itself: "compare()", which introduces a recursion error.
                 Key: PIG-4642
                 URL: https://issues.apache.org/jira/browse/PIG-4642
             Project: Pig
          Issue Type: Bug
    Affects Versions: 0.15.0, 0.14.0, 0.13.0
            Reporter: songwanging


In method "compare" of class: pig-0.15.0\src\org\apache\pig\backend\hadoop\executionengine\mapReduceLayer\PigTupleSortComparator.java 

when comparing two instances of class "Tuple", should use "compareTuple", while in current version the method "compare" using itself: "compare", which introduces a recursion error.

  public int compare(Object o1, Object o2) {
        NullableTuple nt1 = (NullableTuple) o1;
        NullableTuple nt2 = (NullableTuple) o2;
        int rc = 0;

        // If either are null, handle differently.
        if (!nt1.isNull() && !nt2.isNull()) {
            rc = mComparator.compare((Tuple) nt1.getValueAsPigType(), (Tuple) nt2.getValueAsPigType());
        } 
        ....
        return rc;
    }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)