isPointMBR ? numNestedSecondaryKeyFields / 2 : numNestedSecondaryKeyFields;
RecordDescriptor secondaryRecDescConsideringPointMBR = isPointMBR
? getTaggedRecordDescriptor(secondaryRecDescForPointMBR) : getTaggedRecordDescriptor(secondaryRecDesc);
IOperatorDescriptor primaryScanOp = createPrimaryIndexScanDiskComponentsOp(spec, metadataProvider,
getTaggedRecordDescriptor(dataset.getPrimaryRecordDescriptor(metadataProvider)));
sourceOp = createCastOp(spec, dataset.getDatasetType(), index.isEnforced());
spec.connect(new OneToOneConnectorDescriptor(spec), primaryScanOp, 0, sourceOp, 0);
AlgebricksMetaOperatorDescriptor asterixAssignOp = createAssignOp(spec,
numNestedSecondaryKeFieldsConsideringPointMBR, secondaryRecDescConsideringPointMBR);
IOperatorDescriptor processorOp = createTupleProcessorOp(spec, secondaryRecDescConsideringPointMBR,
numNestedSecondaryKeFieldsConsideringPointMBR, numPrimaryKeys, false);
ExternalSortOperatorDescriptor sortOp = createSortOp(spec,
getTaggedSecondaryComparatorFactories(new IBinaryComparatorFactory[] {
MetadataProvider.proposeLinearizer(keyType, secondaryComparatorFactories.length) }),
secondaryRecDescConsideringPointMBR);
LSMSecondaryIndexBulkLoadOperatorDescriptor secondaryBulkLoadOp = createTreeIndexBulkLoadOp(spec,
metadataProvider, secondaryRecDescConsideringPointMBR, createFieldPermutationForBulkLoadOp(),
numNestedSecondaryKeFieldsConsideringPointMBR, numPrimaryKeys, false);