Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-4896

Param substitution ignored when redefined

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.17.0
    • parser
    • None
    • Reviewed

    Description

      After PIG-3359, the way we cache parameter substitution results changed a bit.

      test.pig
      A = load 'input.txt' ;
      %declare output '/tmp/abc';
      %declare actualoutput '$output.out';
      store A into '$actualoutput';
      
      %declare output '/tmp/def';
      %declare actualoutput '$output.out';
      store A into '$actualoutput';
      
      %declare number '1d';
      %declare shellout `bash -c "date -v-$number +'%Y%m%d_%H:%S_%s'; sleep 1" `
      store A into '$shellout';
      
      %declare shellout `bash -c "date -v-$number +'%Y%m%d_%H:%S_%s'; sleep 1" `
      store A into '$shellout';
      
      %declare number '2d';
      %declare shellout `bash -c "date -v-$number +'%Y%m%d_%H:%S_%s'; sleep 1" `
      store A into '$shellout';
      

      Result from pig 0.11 (almost correct)

      A = load 'input.txt' ;
      store A into '/tmp/abc.out';
      store A into '/tmp/def.out';
      store A into '20160515_17:32_1463346752';
      store A into '20160515_17:33_1463346753'; NO
      store A into '20160514_17:34_1463260354';

      Result from trunk

      A = load 'input.txt' ;
      store A into '/tmp/abc.out';
      store A into '/tmp/abc.out'; NO
      store A into '20160515_15:10_1463338810';
      store A into '20160515_15:10_1463338810';
      store A into '20160515_15:10_1463338810'; NO

      Attachments

        1. pig-4896-v01.patch
          9 kB
          Koji Noguchi
        2. pig-4896-v02.patch
          9 kB
          Koji Noguchi
        3. pig-4896-v03.patch
          9 kB
          Koji Noguchi
        4. pig-4896-v04.patch
          8 kB
          Koji Noguchi
        5. pig-4896-v05.patch
          8 kB
          Koji Noguchi

        Issue Links

          Activity

            People

              knoguchi Koji Noguchi
              knoguchi Koji Noguchi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: