Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-18860

Incorrect results and no warning when file position field is missing from payload on an index definition.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.0.0
    • Component/s: Code Generator
    • Labels:
      None

      Description

      Example:

      rhsRec := RECORD
       unsigned4 key;
       string10 f1;
       string10 f2;
      END;
      
      lhsRec := RECORD
       unsigned4 lhsKey;
      END;
      
      rhs := DATASET([{1, 'a', 'b'}, {1, 'a2', 'b2'}, {1, 'a3', 'b3'}, {2, 'c', 'd'}, {3, 'e', 'f'}], rhsRec);
      rhsDs := DATASET('~rhsDs', rhsRec, FLAT);
      
      lhs := DATASET([{1}], lhsRec);
      
      i := INDEX(rhsDs, {key} , {f1}, '~rhsDs.idx');
      
      rhsRec doJoinTrans(lhsRec l, rhsRec r) := TRANSFORM
       SELF.key := l.lhsKey;
       SELF := r;
      END;
      
      j8 := JOIN(lhs, rhsDs, LEFT.lhsKey=RIGHT.key AND RIGHT.f2 != 'b2', doJoinTrans(LEFT, RIGHT), KEYED(i), KEEP(2));
      
      SEQUENTIAL(
       OUTPUT(rhs, , '~rhsDs', OVERWRITE);
       BUILD(i, OVERWRITE);
       OUTPUT(j8);
      );
      

      This is fixed by adding a virtual fileposition field and giving that record definition to the dataset and adding the virtual filepos to the payload of the index definition.
      However without it, there is no warning and the results for f1 and f2 fields are wrong.

        Attachments

          Activity

            People

            • Assignee:
              ghalliday Gavin Halliday
              Reporter:
              jakesmith Jake Smith
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: