소스 검색

Merge pull request #9620 from jakesmith/hpcc-17036

HPCC-17036 Non interleaved superindexes in a keyed join lost data

Reviewed-By: Mark Kelly <mark.kelly@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 8 년 전
부모
커밋
bb7349041e
2개의 변경된 파일19개의 추가작업 그리고 5개의 파일을 삭제
  1. 18 4
      thorlcr/activities/keyedjoin/thkeyedjoin.cpp
  2. 1 1
      thorlcr/activities/keyedjoin/thkeyedjoinslave.cpp

+ 18 - 4
thorlcr/activities/keyedjoin/thkeyedjoin.cpp

@@ -154,11 +154,25 @@ public:
             {
                 initMb.append(numParts);
                 initMb.append(superIndexWidth); // 0 if not superIndex
-                initMb.append((superIndex && superIndex->isInterleaved()) ? numSuperIndexSubs : 0);
-                unsigned p=0;
+                bool interleaved = superIndex && superIndex->isInterleaved();
+                initMb.append(interleaved ? numSuperIndexSubs : 0);
                 UnsignedArray parts;
-                for (; p<numParts; p++)
-                    parts.append(p);
+                if (!superIndex || interleaved) // serialize first numParts parts, TLK are at end and are serialized separately.
+                {
+                    for (unsigned p=0; p<numParts; p++)
+                        parts.append(p);
+                }
+                else // non-interleaved superindex
+                {
+                    unsigned p=0;
+                    for (unsigned i=0; i<numSuperIndexSubs; i++)
+                    {
+                        for (unsigned kp=0; kp<superIndexWidth; kp++)
+                            parts.append(p++);
+                        if (keyHasTlk)
+                            p++; // TLK's serialized separately.
+                    }
+                }
                 indexFileDesc->serializeParts(initMb, parts);
                 if (localKey)
                     keyHasTlk = false; // not used

+ 1 - 1
thorlcr/activities/keyedjoin/thkeyedjoinslave.cpp

@@ -1852,7 +1852,7 @@ public:
             unsigned numSuperIndexSubs;
             data.read(superWidth);
             data.read(numSuperIndexSubs);
-            if (numSuperIndexSubs)
+            if (numSuperIndexSubs) // if 0 means not interleaved
             {
                 CPartDescriptorArray _indexParts;
                 deserializePartFileDescriptors(data, _indexParts);