mirror of https://github.com/citusdata/citus.git
Implement BuildStripeMetadata
parent
2552aee404
commit
f846c16514
|
@ -71,6 +71,7 @@ static void GetHighestUsedAddressAndId(uint64 storageId,
|
||||||
uint64 *highestUsedAddress,
|
uint64 *highestUsedAddress,
|
||||||
uint64 *highestUsedId);
|
uint64 *highestUsedId);
|
||||||
static List * ReadDataFileStripeList(uint64 storageId, Snapshot snapshot);
|
static List * ReadDataFileStripeList(uint64 storageId, Snapshot snapshot);
|
||||||
|
static StripeMetadata * BuildStripeMetadata(Datum *datumArray);
|
||||||
static uint32 * ReadChunkGroupRowCounts(uint64 storageId, uint64 stripe, uint32
|
static uint32 * ReadChunkGroupRowCounts(uint64 storageId, uint64 stripe, uint32
|
||||||
chunkGroupCount);
|
chunkGroupCount);
|
||||||
static Oid ColumnarStorageIdSequenceRelationId(void);
|
static Oid ColumnarStorageIdSequenceRelationId(void);
|
||||||
|
@ -840,7 +841,24 @@ ReadDataFileStripeList(uint64 storageId, Snapshot snapshot)
|
||||||
bool isNullArray[Natts_columnar_stripe];
|
bool isNullArray[Natts_columnar_stripe];
|
||||||
|
|
||||||
heap_deform_tuple(heapTuple, tupleDescriptor, datumArray, isNullArray);
|
heap_deform_tuple(heapTuple, tupleDescriptor, datumArray, isNullArray);
|
||||||
|
StripeMetadata *stripeMetadata = BuildStripeMetadata(datumArray);
|
||||||
|
stripeMetadataList = lappend(stripeMetadataList, stripeMetadata);
|
||||||
|
}
|
||||||
|
|
||||||
|
systable_endscan_ordered(scanDescriptor);
|
||||||
|
index_close(index, AccessShareLock);
|
||||||
|
table_close(columnarStripes, AccessShareLock);
|
||||||
|
|
||||||
|
return stripeMetadataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* BuildStripeMetadata builds a StripeMetadata object from given datumArray.
|
||||||
|
*/
|
||||||
|
static StripeMetadata *
|
||||||
|
BuildStripeMetadata(Datum *datumArray)
|
||||||
|
{
|
||||||
StripeMetadata *stripeMetadata = palloc0(sizeof(StripeMetadata));
|
StripeMetadata *stripeMetadata = palloc0(sizeof(StripeMetadata));
|
||||||
stripeMetadata->id = DatumGetInt64(datumArray[Anum_columnar_stripe_stripe - 1]);
|
stripeMetadata->id = DatumGetInt64(datumArray[Anum_columnar_stripe_stripe - 1]);
|
||||||
stripeMetadata->fileOffset = DatumGetInt64(
|
stripeMetadata->fileOffset = DatumGetInt64(
|
||||||
|
@ -857,15 +875,7 @@ ReadDataFileStripeList(uint64 storageId, Snapshot snapshot)
|
||||||
datumArray[Anum_columnar_stripe_row_count - 1]);
|
datumArray[Anum_columnar_stripe_row_count - 1]);
|
||||||
stripeMetadata->firstRowNumber = DatumGetUInt64(
|
stripeMetadata->firstRowNumber = DatumGetUInt64(
|
||||||
datumArray[Anum_columnar_stripe_first_row_number - 1]);
|
datumArray[Anum_columnar_stripe_first_row_number - 1]);
|
||||||
|
return stripeMetadata;
|
||||||
stripeMetadataList = lappend(stripeMetadataList, stripeMetadata);
|
|
||||||
}
|
|
||||||
|
|
||||||
systable_endscan_ordered(scanDescriptor);
|
|
||||||
index_close(index, AccessShareLock);
|
|
||||||
table_close(columnarStripes, AccessShareLock);
|
|
||||||
|
|
||||||
return stripeMetadataList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue