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

Create SelectFieldByName UDF - which, given a field who's value contains a field name, and *, returns the value of the field referenced by the field name

    XMLWordPrintableJSON

    Details

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

      Description

      define SelectFieldByName datafu.pig.util.SelectFieldByName();

      data = LOAD 'input' using PigStorage(',') AS (fieldName:chararray, text1:chararray, text2:chararray, text3:chararray);
      data2 = FOREACH data GENERATE fieldName, SelectFieldByName(fieldName,*) as result;
      data3 = FOREACH data2 GENERATE fieldName, result;
      STORE data3 INTO 'output';

        Attachments

        1. DATAFU-69.patch
          5 kB
          Russell Jurney
        2. DATAFU-69.patch
          5 kB
          Russell Jurney
        3. DATAFU-69.patch
          6 kB
          Russell Jurney
        4. DATAFU-69.patch
          5 kB
          Russell Jurney

          Activity

            People

            • Assignee:
              russell.jurney Russell Jurney
              Reporter:
              russell.jurney Russell Jurney
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: