Procházet zdrojové kódy

Merge pull request #12352 from jakesmith/hpcc-21747

HPCC-21747 Compress flag from ECL ignored if reading external file

Reviewed-By: Mark Kelly <mark.kelly@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman před 6 roky
rodič
revize
607c46f429
2 změnil soubory, kde provedl 5 přidání a 2 odebrání
  1. 3 1
      ecl/hthor/hthor.cpp
  2. 2 1
      roxie/ccd/ccdserver.cpp

+ 3 - 1
ecl/hthor/hthor.cpp

@@ -101,7 +101,7 @@ void * checked_calloc(size_t size, size_t num, char const * label)
 
 inline bool checkIsCompressed(unsigned int flags, size32_t fixedSize, bool grouped)
 {
-    return ((flags & TDWnewcompress) || ((flags & TDXcompress) && (fixedSize+(grouped?1:0) >= MIN_ROWCOMPRESS_RECSIZE)));
+    return ((flags & TDWnewcompress) || ((flags & TDXcompress) && ((0 == fixedSize) || (fixedSize+(grouped?1:0) >= MIN_ROWCOMPRESS_RECSIZE))));
 }
 
 //=====================================================================================================
@@ -8120,6 +8120,8 @@ void CHThorDiskReadBaseActivity::resolve()
             Owned<IFileDescriptor> fdesc;
             fdesc.setown(ldFile->getFileDescriptor());
             gatherInfo(fdesc);
+            if (ldFile->isExternal())
+                compressed = checkIsCompressed(helper.getFlags(), fixedDiskRecordSize, false);//grouped=FALSE because fixedDiskRecordSize already includes grouped
             IDistributedFile *dFile = ldFile->queryDistributedFile();
             if (dFile)  //only makes sense for distributed (non local) files
             {

+ 2 - 1
roxie/ccd/ccdserver.cpp

@@ -11685,7 +11685,8 @@ public:
         diskmeta.set(helper.queryDiskRecordSize()->querySerializedDiskMeta());
         if (grouped)
             diskmeta.setown(createDeltaRecordSize(diskmeta, +1));
-        blockcompressed = (((helper.getFlags() & TDWnewcompress) != 0) || (((helper.getFlags() & TDXcompress) != 0) && (diskmeta->getFixedSize() >= MIN_ROWCOMPRESS_RECSIZE))); //always use new compression
+        size32_t fixedSize = diskmeta->getFixedSize();
+        blockcompressed = (((helper.getFlags() & TDWnewcompress) != 0) || (((helper.getFlags() & TDXcompress) != 0) && ((0 == fixedSize) || (fixedSize >= MIN_ROWCOMPRESS_RECSIZE)))); //always use new compression
         encrypted = false; // set later
         tallycrc = true;
         uncompressedBytesWritten = 0;