Uploaded image for project: 'DataFu'
  1. DataFu
  2. DATAFU-31

bags.DistinctBy works incorrectly on string containing minuses

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Labels:
      None

      Description

      How to reproduce:
      Input:

      {(a-b,c), (a-b,d)}

      define distinct as DistinctBy('1')

      input = load 'input' as vs:bag{(v0:chararray,v1:chararray)};
      output = foreach input generate distinct(vs);
      dump output;

      expected: {(a-b,c), (a-b,d)}

      actual:

      {(a-b,c)}

      The bug is caused by the implementation based on splitting the tuple string by '-' to get tuple parts.

        Attachments

          Activity

            People

            • Assignee:
              king821221 jian wang
              Reporter:
              romezz Roman Borisov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: