瀏覽代碼

Merge pull request #12975 from richardkchapman/roxie-crc

HPCC-22820 Roxie will not attempt to create a translator from file with alien data type

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 5 年之前
父節點
當前提交
5cde6fa3c7
共有 1 個文件被更改,包括 15 次插入2 次删除
  1. 15 2
      roxie/ccd/ccdfile.cpp

+ 15 - 2
roxie/ccd/ccdfile.cpp

@@ -2116,11 +2116,17 @@ public:
                 bool actualUnknown = true;
                 if (mode != RecordTranslationMode::AlwaysECL)
                 {
+                    thisFormatCrc = formatCrcs.item(idx);
                     if (diskTypeInfo.item(idx))
+                    {
                         actual = diskTypeInfo.item(idx);
-                    else
                         actualUnknown = false;
-                    thisFormatCrc = formatCrcs.item(idx);
+                    }
+                    else if (thisFormatCrc == expectedFormatCrc)  // Type descriptors that cannot be serialized can still be read from code
+                    {
+                        actual = expected;
+                        actualUnknown = false;
+                    }
                 }
 
                 assertex(actual);
@@ -2138,6 +2144,13 @@ public:
                         if (traceLevel > 5)
                             DBGLOG("Assume no translation required, crc's match");
                     }
+                    else if (actualUnknown && mode != RecordTranslationMode::AlwaysECL)
+                    {
+                        if (thisFormatCrc)
+                            throw MakeStringException(ROXIE_MISMATCH, "Untranslatable record layout mismatch detected for file %s (disk format not serialized)", subname);
+                        else if (traceLevel > 5)
+                            DBGLOG("Assume no translation required, disk format unknown");
+                    }
                     else
                     {
                         translator.setown(createRecordTranslator(projected->queryRecordAccessor(true), actual->queryRecordAccessor(true)));