|
@@ -348,10 +348,10 @@ class CSpillableStream : public CSpillableStreamBase, implements IRowStream
|
|
|
public:
|
|
|
IMPLEMENT_IINTERFACE_USING(CSimpleInterface);
|
|
|
|
|
|
- CSpillableStream(CActivityBase &_activity, CThorSpillableRowArray &inRows, IRowInterfaces *_rowIf, bool _preserveNulls, unsigned _spillPriority)
|
|
|
+ CSpillableStream(CActivityBase &_activity, CThorSpillableRowArray &inRows, IRowInterfaces *_rowIf, bool _preserveNulls, unsigned _spillPriority, bool _compressSpills)
|
|
|
: CSpillableStreamBase(_activity, inRows, _rowIf, _preserveNulls, _spillPriority)
|
|
|
{
|
|
|
- useCompression = activity.getOptBool(THOROPT_COMPRESS_SPILLS, true);
|
|
|
+ useCompression = _compressSpills;
|
|
|
pos = numReadRows = 0;
|
|
|
granularity = 500; // JCSMORE - rows
|
|
|
|
|
@@ -1423,10 +1423,10 @@ void CThorSpillableRowArray::transferRowsCopy(const void **outRows, bool takeOwn
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-IRowStream *CThorSpillableRowArray::createRowStream(unsigned spillPriority)
|
|
|
+IRowStream *CThorSpillableRowArray::createRowStream(unsigned spillPriority, bool compressSpills)
|
|
|
{
|
|
|
assertex(rowIf);
|
|
|
- return new CSpillableStream(activity, *this, rowIf, allowNulls, spillPriority);
|
|
|
+ return new CSpillableStream(activity, *this, rowIf, allowNulls, spillPriority, compressSpills);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1452,6 +1452,7 @@ protected:
|
|
|
bool mmRegistered;
|
|
|
Owned<CSharedSpillableRowSet> spillableRowSet;
|
|
|
unsigned options;
|
|
|
+ bool compressSpills;
|
|
|
|
|
|
bool spillRows()
|
|
|
{
|
|
@@ -1474,7 +1475,7 @@ protected:
|
|
|
GetTempName(tempName, tempPrefix.str(), true);
|
|
|
Owned<IFile> iFile = createIFile(tempName.str());
|
|
|
VStringBuffer spillPrefixStr("RowCollector(%d)", spillPriority);
|
|
|
- spillableRows.save(*iFile, activity.getOptBool(THOROPT_COMPRESS_SPILLS, true), spillPrefixStr.str()); // saves committed rows
|
|
|
+ spillableRows.save(*iFile, compressSpills, spillPrefixStr.str()); // saves committed rows
|
|
|
spillFiles.append(new CFileOwner(iFile.getLink()));
|
|
|
++overflowCount;
|
|
|
|
|
@@ -1553,7 +1554,7 @@ protected:
|
|
|
// NB: CStreamFileOwner links CFileOwner - last usage will auto delete file
|
|
|
// which may be one of these streams or CThorRowCollectorBase itself
|
|
|
unsigned rwFlags = DEFAULT_RWFLAGS;
|
|
|
- if (activity.getOptBool(THOROPT_COMPRESS_SPILLS, true))
|
|
|
+ if (compressSpills)
|
|
|
rwFlags |= rw_compress;
|
|
|
if (preserveGrouping)
|
|
|
rwFlags |= rw_grouped;
|
|
@@ -1592,7 +1593,7 @@ protected:
|
|
|
return NULL;
|
|
|
}
|
|
|
if (!shared)
|
|
|
- instrms.append(*spillableRows.createRowStream(spillPriority)); // NB: stream will take ownership of rows in spillableRows
|
|
|
+ instrms.append(*spillableRows.createRowStream(spillPriority, compressSpills)); // NB: stream will take ownership of rows in spillableRows
|
|
|
else
|
|
|
{
|
|
|
spillableRowSet.setown(new CSharedSpillableRowSet(activity, spillableRows, rowIf, preserveGrouping, spillPriority));
|
|
@@ -1659,6 +1660,7 @@ public:
|
|
|
maxCores = activity.queryMaxCores();
|
|
|
options = 0;
|
|
|
spillableRows.setup(rowIf, false, stableSort);
|
|
|
+ compressSpills = activity.getOptBool(THOROPT_COMPRESS_SPILLS, true);
|
|
|
}
|
|
|
~CThorRowCollectorBase()
|
|
|
{
|