|
@@ -402,6 +402,16 @@ static IHqlExpression * nextDiskField(IHqlExpression * diskRecord, unsigned & di
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+static IHqlExpression * queryOriginalKey(IHqlExpression * expr)
|
|
|
+{
|
|
|
+ IHqlExpression * original = queryAttributeChild(expr, _original_Atom, 0);
|
|
|
+ if (original)
|
|
|
+ return original;
|
|
|
+ else
|
|
|
+ return expr;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
static void createPhysicalLogicalAssigns(HqlExprArray & assigns, IHqlExpression * self, IHqlExpression * diskRecord, IHqlExpression * record, IHqlExpression * diskDataset, bool allowTranslate, unsigned fileposIndex)
|
|
|
{
|
|
@@ -475,11 +485,11 @@ IHqlExpression * HqlCppTranslator::convertToPhysicalIndex(IHqlExpression * table
|
|
|
IHqlExpression * record = tableExpr->queryRecord();
|
|
|
|
|
|
HqlMapTransformer mapper;
|
|
|
- bool hasFileposition = getBoolAttribute(tableExpr, filepositionAtom, true);
|
|
|
- IHqlExpression * diskRecord = createPhysicalIndexRecord(mapper, record, hasFileposition, false);
|
|
|
+ bool hasFilePosition = getBoolAttribute(tableExpr, filepositionAtom, true);
|
|
|
+ IHqlExpression * diskRecord = createPhysicalIndexRecord(mapper, record, hasFilePosition, false);
|
|
|
|
|
|
unsigned payload = numPayloadFields(tableExpr);
|
|
|
- assertex(payload || !hasFileposition);
|
|
|
+ assertex(payload || !hasFilePosition);
|
|
|
HqlExprArray args;
|
|
|
unwindChildren(args, tableExpr);
|
|
|
args.replace(*diskRecord, 1);
|
|
@@ -491,7 +501,7 @@ IHqlExpression * HqlCppTranslator::convertToPhysicalIndex(IHqlExpression * table
|
|
|
IHqlExpression * newDataset = createDataset(tableExpr->getOperator(), args);
|
|
|
|
|
|
HqlExprArray assigns;
|
|
|
- createPhysicalLogicalAssigns(assigns, newDataset, tableExpr, hasFileposition);
|
|
|
+ createPhysicalLogicalAssigns(assigns, newDataset, tableExpr, hasFilePosition);
|
|
|
OwnedHqlExpr projectedTable = createDataset(no_newusertable, newDataset, createComma(LINK(record), createValue(no_newtransform, makeTransformType(record->getType()), assigns)));
|
|
|
physicalIndexCache.setValue(tableExpr, projectedTable);
|
|
|
return projectedTable.getClear();
|
|
@@ -511,8 +521,26 @@ IHqlExpression * convertToPhysicalTable(IHqlExpression * tableExpr, bool ensureS
|
|
|
IHqlExpression * HqlCppTranslator::buildIndexFromPhysical(IHqlExpression * expr)
|
|
|
{
|
|
|
IHqlExpression * tableExpr = queryPhysicalRootTable(expr);
|
|
|
+ OwnedHqlExpr newProject;
|
|
|
+ if (queryOptions().newIndexReadMapping && !recordContainsBlobs(tableExpr->queryRecord()))
|
|
|
+ {
|
|
|
+ //once it is legal for the input to a transform to be non-serialized then following should be enabled
|
|
|
+ //return LINK(expr);
|
|
|
+
|
|
|
+ IHqlExpression * record = tableExpr->queryChild(1);
|
|
|
+ OwnedHqlExpr diskRecord = getSerializedForm(record, diskAtom);
|
|
|
+ if (record == diskRecord)
|
|
|
+ return LINK(expr);
|
|
|
|
|
|
- OwnedHqlExpr newProject = convertToPhysicalIndex(tableExpr);
|
|
|
+ OwnedHqlExpr newDataset = replaceChild(tableExpr, 1, diskRecord);
|
|
|
+
|
|
|
+ VirtualRecordTransformCreator mapper(newDataset);
|
|
|
+ IHqlExpression * newTransform = mapper.createMappingTransform(no_newtransform, record, newDataset);
|
|
|
+ newProject.setown(createDatasetF(no_newusertable, LINK(newDataset), LINK(record), newTransform, createAttribute(_internal_Atom), NULL));
|
|
|
+ newProject.setown(tableExpr->cloneAllAnnotations(newProject));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ newProject.setown(convertToPhysicalIndex(tableExpr));
|
|
|
return replaceExpression(expr, tableExpr, newProject);
|
|
|
}
|
|
|
|
|
@@ -596,11 +624,18 @@ public:
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
+static bool forceLegacyMapping(IHqlExpression * expr)
|
|
|
+{
|
|
|
+ //Use __OPTION__(LEGACY(TRUE)) to force legacy mapping code
|
|
|
+ IHqlExpression * options = expr->queryAttribute(__option__Atom);
|
|
|
+ return getBoolAttribute(options, legacyAtom, false);
|
|
|
+}
|
|
|
+
|
|
|
class SourceBuilder
|
|
|
{
|
|
|
public:
|
|
|
SourceBuilder(HqlCppTranslator & _translator, IHqlExpression *_tableExpr, IHqlExpression *_nameExpr)
|
|
|
- : tableExpr(_tableExpr), translator(_translator)
|
|
|
+ : tableExpr(_tableExpr), translator(_translator), newInputMapping(false)
|
|
|
{
|
|
|
nameExpr.setown(foldHqlExpression(_nameExpr));
|
|
|
needDefaultTransform = true;
|
|
@@ -633,20 +668,27 @@ public:
|
|
|
|
|
|
if (tableExpr)
|
|
|
{
|
|
|
- IHqlExpression * virtualAttr = tableExpr->queryAttribute(virtualAtom);
|
|
|
- newDiskReadMapping = translator.queryOptions().newDiskReadMapping;
|
|
|
- if (virtualAttr)
|
|
|
- newDiskReadMapping = !getBoolAttribute(virtualAttr, legacyAtom);
|
|
|
+ if (isKey(tableExpr))
|
|
|
+ newInputMapping = translator.queryOptions().newIndexReadMapping;
|
|
|
+ else
|
|
|
+ newInputMapping = translator.queryOptions().newDiskReadMapping;
|
|
|
+
|
|
|
+ if (forceLegacyMapping(tableExpr))
|
|
|
+ newInputMapping = false;
|
|
|
+
|
|
|
+ //If this index has been translated using the legacy method then ensure we continue to use that method
|
|
|
+ if (isKey(tableExpr) && queryAttributeChild(tableExpr, _original_Atom, 0))
|
|
|
+ newInputMapping = false;
|
|
|
switch (tableExpr->getOperator())
|
|
|
{
|
|
|
case no_fetch:
|
|
|
case no_compound_fetch:
|
|
|
- newDiskReadMapping = false;
|
|
|
+ newInputMapping = false;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
- newDiskReadMapping = false;
|
|
|
+ newInputMapping = false;
|
|
|
}
|
|
|
virtual ~SourceBuilder() {}
|
|
|
|
|
@@ -671,6 +713,8 @@ public:
|
|
|
bool containsStepping(IHqlExpression * expr);
|
|
|
ABoundActivity * buildActivity(BuildCtx & ctx, IHqlExpression * expr, ThorActivityKind activityKind, const char *kind, ABoundActivity *input);
|
|
|
void gatherVirtualFields(bool ignoreVirtuals, bool ensureSerialized);
|
|
|
+ void deduceDiskRecords();
|
|
|
+ void deduceIndexRecords();
|
|
|
bool recordHasVirtuals() { return fieldInfo.hasVirtuals(); }
|
|
|
bool recordHasVirtualsOrDeserialize() { return fieldInfo.hasVirtualsOrDeserialize(); }
|
|
|
bool isSourceInvariant(IHqlExpression * dataset, IHqlExpression * expr);
|
|
@@ -728,6 +772,7 @@ public:
|
|
|
HqlExprAttr failedFilterValue;
|
|
|
HqlExprAttr compoundCountVar;
|
|
|
HqlExprAttr physicalRecord;
|
|
|
+ HqlExprAttr inputRecord; // The format of the row that is passed to the transform
|
|
|
LinkedHqlExpr expectedRecord;
|
|
|
LinkedHqlExpr projectedRecord;
|
|
|
LinkedHqlExpr tableSelector;
|
|
@@ -754,7 +799,7 @@ public:
|
|
|
bool isUnfilteredCount;
|
|
|
bool isVirtualLogicalFilenameUsed;
|
|
|
bool requiresOrderedMerge;
|
|
|
- bool newDiskReadMapping;
|
|
|
+ bool newInputMapping;
|
|
|
bool extractCanMatch = false;
|
|
|
protected:
|
|
|
HqlCppTranslator & translator;
|
|
@@ -864,11 +909,11 @@ void SourceBuilder::analyse(IHqlExpression * expr)
|
|
|
{
|
|
|
case no_table:
|
|
|
case no_newkeyindex:
|
|
|
- if (!newDiskReadMapping)
|
|
|
+ if (!newInputMapping)
|
|
|
{
|
|
|
assertex(!fieldInfo.hasVirtuals());
|
|
|
}
|
|
|
- if (newDiskReadMapping)
|
|
|
+ if (newInputMapping)
|
|
|
{
|
|
|
if (!tableExpr->hasAttribute(_noVirtual_Atom) && (tableExpr->queryChild(2)->getOperator() != no_pipe))
|
|
|
{
|
|
@@ -1254,7 +1299,7 @@ void SourceBuilder::buildTransformElements(BuildCtx & ctx, IHqlExpression * expr
|
|
|
{
|
|
|
case no_newkeyindex:
|
|
|
case no_table:
|
|
|
- if (newDiskReadMapping)
|
|
|
+ if (newInputMapping)
|
|
|
{
|
|
|
}
|
|
|
else
|
|
@@ -2025,19 +2070,8 @@ ABoundActivity * SourceBuilder::buildActivity(BuildCtx & ctx, IHqlExpression * e
|
|
|
case TAKindexgroupaggregate:
|
|
|
case TAKindexexists:
|
|
|
{
|
|
|
- LinkedHqlExpr indexExpr = queryAttributeChild(tableExpr, _original_Atom, 0);
|
|
|
- OwnedHqlExpr serializedRecord;
|
|
|
- unsigned numPayload = numPayloadFields(indexExpr);
|
|
|
- if (numPayload)
|
|
|
- serializedRecord.setown(notePayloadFields(indexExpr->queryRecord(), numPayload));
|
|
|
- else
|
|
|
- serializedRecord.set(indexExpr->queryRecord());
|
|
|
- serializedRecord.setown(getSerializedForm(serializedRecord, diskAtom));
|
|
|
-
|
|
|
- bool hasFilePosition = getBoolAttribute(indexExpr, filepositionAtom, true);
|
|
|
- serializedRecord.setown(createMetadataIndexRecord(serializedRecord, hasFilePosition));
|
|
|
- translator.buildMetaMember(instance->classctx, serializedRecord, false, "queryDiskRecordSize");
|
|
|
- translator.buildMetaMember(instance->classctx, serializedRecord, false, "queryProjectedDiskRecordSize");
|
|
|
+ translator.buildMetaMember(instance->classctx, expectedRecord, false, "queryDiskRecordSize");
|
|
|
+ translator.buildMetaMember(instance->classctx, projectedRecord, false, "queryProjectedDiskRecordSize");
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -2556,7 +2590,7 @@ void SourceBuilder::buildCanMatch(IHqlExpression * expr)
|
|
|
MemberFunction func(translator, instance->startctx);
|
|
|
func.start("virtual bool canMatch(const void * _left) override");
|
|
|
func.ctx.addQuotedLiteral("unsigned char * left = (unsigned char *)_left;");
|
|
|
- if (newDiskReadMapping)
|
|
|
+ if (newInputMapping)
|
|
|
translator.bindTableCursor(func.ctx, projectedSelector, "left");
|
|
|
else
|
|
|
translator.bindTableCursor(func.ctx, tableExpr, "left");
|
|
@@ -2627,7 +2661,22 @@ void SourceBuilder::gatherVirtualFields(bool ignoreVirtuals, bool ensureSerializ
|
|
|
else
|
|
|
physicalRecord.set(record);
|
|
|
|
|
|
- if (newDiskReadMapping)
|
|
|
+ expectedRecord.set(physicalRecord);
|
|
|
+ projectedRecord.set(physicalRecord);
|
|
|
+
|
|
|
+ tableSelector.set(tableExpr->queryNormalizedSelector());
|
|
|
+ projectedSelector.set(tableSelector);
|
|
|
+}
|
|
|
+
|
|
|
+void SourceBuilder::deduceDiskRecords()
|
|
|
+{
|
|
|
+ HqlExprAttr mode = tableExpr->queryChild(2);
|
|
|
+ node_operator modeOp = mode->getOperator();
|
|
|
+ bool isPiped = modeOp==no_pipe;
|
|
|
+
|
|
|
+ gatherVirtualFields(tableExpr->hasAttribute(_noVirtual_Atom) || isPiped, needToSerializeRecord(modeOp));
|
|
|
+
|
|
|
+ if (newInputMapping)
|
|
|
{
|
|
|
projectedRecord.set(tableExpr->queryRecord());
|
|
|
expectedRecord.setown(getSerializedForm(physicalRecord, diskAtom));
|
|
@@ -2643,11 +2692,39 @@ void SourceBuilder::gatherVirtualFields(bool ignoreVirtuals, bool ensureSerializ
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- expectedRecord.set(physicalRecord);
|
|
|
- projectedRecord.set(physicalRecord);
|
|
|
+ projectedRecord.set(tableExpr->queryRecord());
|
|
|
+ expectedRecord.setown(getSerializedForm(physicalRecord, diskAtom));
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+void SourceBuilder::deduceIndexRecords()
|
|
|
+{
|
|
|
+ gatherVirtualFields(true, true);
|
|
|
+
|
|
|
+ //A slightly round about way to get the meta including keyed/blob information for the physical file.
|
|
|
+ IHqlExpression * indexExpr = queryOriginalKey(tableExpr);
|
|
|
+ OwnedHqlExpr serializedRecord;
|
|
|
+ unsigned numPayload = numPayloadFields(indexExpr);
|
|
|
+ if (numPayload)
|
|
|
+ serializedRecord.setown(notePayloadFields(indexExpr->queryRecord(), numPayload));
|
|
|
+ else
|
|
|
+ serializedRecord.set(indexExpr->queryRecord());
|
|
|
+ serializedRecord.setown(getSerializedForm(serializedRecord, diskAtom));
|
|
|
+
|
|
|
+ bool hasFilePosition = getBoolAttribute(indexExpr, filepositionAtom, true);
|
|
|
+ expectedRecord.setown(createMetadataIndexRecord(serializedRecord, hasFilePosition));
|
|
|
+
|
|
|
+ if (newInputMapping)
|
|
|
+ {
|
|
|
+ //We are expecting the translator to map the field values, this uses the expected ecl structure
|
|
|
+ projectedRecord.set(tableExpr->queryRecord());
|
|
|
+ //physical?
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ projectedRecord.set(expectedRecord); // This needs to match expectedRecord so that no translation occurs on keyed fields etc.
|
|
|
}
|
|
|
- tableSelector.set(tableExpr->queryNormalizedSelector());
|
|
|
- projectedSelector.set(tableSelector);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -2825,7 +2902,7 @@ void DiskReadBuilderBase::buildMembers(IHqlExpression * expr)
|
|
|
OwnedHqlExpr noVirtualRecord = removeVirtualAttributes(expectedRecord);
|
|
|
translator.buildFormatCrcFunction(instance->classctx, "getDiskFormatCrc", noVirtualRecord);
|
|
|
|
|
|
- if (newDiskReadMapping)
|
|
|
+ if (newInputMapping)
|
|
|
translator.buildFormatCrcFunction(instance->classctx, "getProjectedFormatCrc", projectedRecord);
|
|
|
else
|
|
|
translator.buildFormatCrcFunction(instance->classctx, "getProjectedFormatCrc", noVirtualRecord);
|
|
@@ -2966,7 +3043,7 @@ protected:
|
|
|
void DiskReadBuilder::analyseGraph(IHqlExpression * expr)
|
|
|
{
|
|
|
DiskReadBuilderBase::analyseGraph(expr);
|
|
|
- if (newDiskReadMapping && extractCanMatch && firstTransformer)
|
|
|
+ if (newInputMapping && extractCanMatch && firstTransformer)
|
|
|
{
|
|
|
//Calculate the minimum set of fields required by any post-filters and projects.
|
|
|
projectedRecord.setown(getMinimumInputRecord(translator, firstTransformer));
|
|
@@ -3110,10 +3187,10 @@ ABoundActivity * HqlCppTranslator::doBuildActivityDiskRead(BuildCtx & ctx, IHqlE
|
|
|
bool isPiped = modeOp==no_pipe;
|
|
|
|
|
|
DiskReadBuilder info(*this, tableExpr, tableExpr->queryChild(0));
|
|
|
- info.gatherVirtualFields(tableExpr->hasAttribute(_noVirtual_Atom) || isPiped, needToSerializeRecord(modeOp));
|
|
|
+ info.deduceDiskRecords();
|
|
|
|
|
|
unsigned optFlags = (options.foldOptimized ? HOOfold : 0);
|
|
|
- if (info.newDiskReadMapping && (modeOp != no_csv) && (modeOp != no_xml) && (modeOp != no_pipe))
|
|
|
+ if (info.newInputMapping && (modeOp != no_csv) && (modeOp != no_xml) && (modeOp != no_pipe))
|
|
|
{
|
|
|
//The projected disk information (which is passed to the transform) uses the in memory format IFF
|
|
|
// - The disk read is a trivial slimming transform (so no transform needs calling on the projected disk format.
|
|
@@ -3232,7 +3309,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivityDiskNormalize(BuildCtx & ctx,
|
|
|
assertex(mode->getOperator()!=no_pipe);
|
|
|
|
|
|
DiskNormalizeBuilder info(*this, tableExpr, tableExpr->queryChild(0));
|
|
|
- info.gatherVirtualFields(tableExpr->hasAttribute(_noVirtual_Atom), needToSerializeRecord(mode));
|
|
|
+ info.deduceDiskRecords();
|
|
|
|
|
|
LinkedHqlExpr transformed = expr;
|
|
|
if (info.recordHasVirtualsOrDeserialize())
|
|
@@ -3391,7 +3468,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivityDiskAggregate(BuildCtx & ctx,
|
|
|
assertex(mode->getOperator()!=no_pipe);
|
|
|
|
|
|
DiskAggregateBuilder info(*this, tableExpr, tableExpr->queryChild(0));
|
|
|
- info.gatherVirtualFields(tableExpr->hasAttribute(_noVirtual_Atom), needToSerializeRecord(mode));
|
|
|
+ info.deduceDiskRecords();
|
|
|
|
|
|
LinkedHqlExpr transformed = expr;
|
|
|
if (info.recordHasVirtualsOrDeserialize())
|
|
@@ -3405,7 +3482,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivityDiskAggregate(BuildCtx & ctx,
|
|
|
if (aggOp == no_countgroup || aggOp == no_existsgroup)
|
|
|
{
|
|
|
DiskCountBuilder info(*this, tableExpr, tableExpr->queryChild(0), aggOp);
|
|
|
- info.gatherVirtualFields(tableExpr->hasAttribute(_noVirtual_Atom), needToSerializeRecord(mode));
|
|
|
+ info.deduceDiskRecords();
|
|
|
|
|
|
return info.buildActivity(ctx, expr, TAKdiskcount, "DiskCount", NULL);
|
|
|
}
|
|
@@ -3469,7 +3546,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivityDiskGroupAggregate(BuildCtx &
|
|
|
assertex(mode->getOperator()!=no_pipe);
|
|
|
|
|
|
DiskGroupAggregateBuilder info(*this, tableExpr, tableExpr->queryChild(0));
|
|
|
- info.gatherVirtualFields(tableExpr->hasAttribute(_noVirtual_Atom), needToSerializeRecord(mode));
|
|
|
+ info.deduceDiskRecords();
|
|
|
|
|
|
LinkedHqlExpr transformed = expr;
|
|
|
if (info.recordHasVirtualsOrDeserialize())
|
|
@@ -3821,9 +3898,21 @@ void IndexReadBuilderBase::buildMembers(IHqlExpression * expr)
|
|
|
|
|
|
buildKeyedLimitHelper(expr);
|
|
|
|
|
|
- translator.buildFormatCrcFunction(instance->classctx, "getDiskFormatCrc", true, tableExpr, tableExpr, 1);
|
|
|
- translator.buildFormatCrcFunction(instance->classctx, "getProjectedFormatCrc", true, tableExpr, tableExpr, 1);
|
|
|
- IHqlExpression * originalKey = queryAttributeChild(tableExpr, _original_Atom, 0);
|
|
|
+ LinkedHqlExpr diskRecord = tableExpr->queryRecord();
|
|
|
+ if (newInputMapping)
|
|
|
+ {
|
|
|
+ HqlMapTransformer mapper;
|
|
|
+ bool hasFilePosition = getBoolAttribute(tableExpr, filepositionAtom, true);
|
|
|
+ diskRecord.setown(createPhysicalIndexRecord(mapper, diskRecord, hasFilePosition, false));
|
|
|
+ }
|
|
|
+
|
|
|
+ translator.buildFormatCrcFunction(instance->classctx, "getDiskFormatCrc", true, diskRecord, tableExpr, 1);
|
|
|
+ if (newInputMapping || (!tableExpr || !isKey(tableExpr)))
|
|
|
+ translator.buildFormatCrcFunction(instance->classctx, "getProjectedFormatCrc", projectedRecord);
|
|
|
+ else
|
|
|
+ translator.buildFormatCrcFunction(instance->classctx, "getProjectedFormatCrc", true, diskRecord, tableExpr, 1); // backward compatibility for indexes
|
|
|
+
|
|
|
+ IHqlExpression * originalKey = queryOriginalKey(tableExpr);
|
|
|
translator.buildSerializedLayoutMember(instance->classctx, originalKey->queryRecord(), "getIndexLayout", numKeyedFields(originalKey));
|
|
|
|
|
|
//Note the helper base class contains code like the following
|
|
@@ -4012,7 +4101,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivityIndexRead(BuildCtx & ctx, IHql
|
|
|
traceExpression("before index read", optimized);
|
|
|
assertex(tableExpr->getOperator() == no_newkeyindex);
|
|
|
NewIndexReadBuilder info(*this, tableExpr, tableExpr->queryChild(3));
|
|
|
- info.gatherVirtualFields(true, true);
|
|
|
+ info.deduceIndexRecords();
|
|
|
if (info.containsStepping(optimized))
|
|
|
return info.buildActivity(ctx, optimized, TAKindexread, "SteppedIndexRead", NULL);
|
|
|
return info.buildActivity(ctx, optimized, TAKindexread, "IndexRead", NULL);
|
|
@@ -4086,7 +4175,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivityIndexNormalize(BuildCtx & ctx,
|
|
|
|
|
|
assertex(tableExpr->getOperator() == no_newkeyindex);
|
|
|
IndexNormalizeBuilder info(*this, tableExpr, tableExpr->queryChild(3));
|
|
|
- info.gatherVirtualFields(true, true);
|
|
|
+ info.deduceIndexRecords();
|
|
|
return info.buildActivity(ctx, optimized, TAKindexnormalize, "IndexNormalize", NULL);
|
|
|
}
|
|
|
|
|
@@ -4245,13 +4334,13 @@ ABoundActivity * HqlCppTranslator::doBuildActivityIndexAggregate(BuildCtx & ctx,
|
|
|
if (aggOp == no_countgroup || aggOp == no_existsgroup)
|
|
|
{
|
|
|
IndexCountBuilder info(*this, tableExpr, tableExpr->queryChild(3), aggOp);
|
|
|
- info.gatherVirtualFields(true, true);
|
|
|
+ info.deduceIndexRecords();
|
|
|
return info.buildActivity(ctx, optimized, TAKindexcount, "IndexCount", NULL);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
IndexAggregateBuilder info(*this, tableExpr, tableExpr->queryChild(3));
|
|
|
- info.gatherVirtualFields(true, true);
|
|
|
+ info.deduceIndexRecords();
|
|
|
return info.buildActivity(ctx, optimized, TAKindexaggregate, "IndexAggregate", NULL);
|
|
|
}
|
|
|
}
|
|
@@ -4405,7 +4494,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivityIndexGroupAggregate(BuildCtx &
|
|
|
ThorActivityKind tak = TAKindexgroupaggregate;
|
|
|
assertex(tableExpr->getOperator() == no_newkeyindex);
|
|
|
IndexGroupAggregateBuilder info(*this, tableExpr, tableExpr->queryChild(3));
|
|
|
- info.gatherVirtualFields(true, true);
|
|
|
+ info.deduceIndexRecords();
|
|
|
return info.buildActivity(ctx, optimized, tak, "IndexGroupAggregate", NULL);
|
|
|
}
|
|
|
|
|
@@ -4832,7 +4921,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivityFetch(BuildCtx & ctx, IHqlExpr
|
|
|
if (!tableExpr)
|
|
|
throwError(HQLERR_FetchNonDiskfile);
|
|
|
FetchBuilder info(*this, tableExpr, tableExpr->queryChild(0), expr);
|
|
|
- info.gatherVirtualFields(false, true);//?needToSerializeRecord(mode)
|
|
|
+ info.deduceDiskRecords();//?needToSerializeRecord(mode)
|
|
|
|
|
|
unsigned optFlags = (options.foldOptimized ? HOOfold : 0);
|
|
|
if (info.recordHasVirtualsOrDeserialize())
|