Fennel: LcsColumnReader Class Reference (original) (raw)
Reads RIDs from a single cluster. More...
#include <[LcsColumnReader.h](LcsColumnReader%5F8h-source.html)>
| Public Member Functions | |
|---|---|
| void | init (LcsClusterReader *pScanInit, uint colOrdInit) |
| Initializes a scan of column "colOrdInit". | |
| void | sync () |
| Synchronizes batches for each column when the scan moves to a new range. | |
| bool | batchIsCompressed () const |
| Returns true if current batch for column is compressed. | |
| bool | batchIsFixed () const |
| Returns true if current batch for column is fixed. | |
| const PBuffer | getCurrentValue () |
| Returns current value code for a compressed batch entry. | |
| uint16_t | getCurrentValueCode () const |
| Gets the code (between 0 and GetBatchValCount() - 1) of the current value for a compressed batch. | |
| uint | getBatchValCount () const |
| Returns number of distinct values in batch. | |
| const PBuffer | getBatchBase () const |
| Returns base pointer of batch. | |
| const uint16_t * | getBatchOffsets () const |
| Returns table of offsets from base. | |
| const PBuffer | getBatchValue (uint iValCode) const |
| Gets iValCode-th value. | |
| void | readCompressedBatch (uint count, uint16_t *pValCodes, uint *pActCount) |
| Reads up to "count" value-codes into the "pValCodes" table. | |
| LcsResidualColumnFilters & | getFilters () |
| **Returns:**the filter column | |
| bool | applyFilters (TupleDescriptor &projDescriptor, TupleData &outputTupleData) |
| Applies the filters. | |
| Private Member Functions | |
| const PBuffer | getCompressedValue () |
| Returns value from compressed batch. | |
| const PBuffer | getFixedValue () |
| Returns value from fixed batch. | |
| const PBuffer | getVariableValue () |
| Returns value from variable batch. | |
| uint | findVal (uint filterPos, bool highBound, bool bStrict, TupleDataWithBuffer &readerKeyData) |
| Locates the smallest value in the compressed batch that's greater or equal to a filter predicate's bound. | |
| void | findBounds (uint filterPos, uint &nLoVal, uint &nHiVal, TupleDataWithBuffer &readerKeyData) |
| Locates the range of entries in the compressed batch that passes a filter predicate. | |
| void | buildContainsMap () |
| Builds the contains bitmap for compressed batch. | |
| Private Attributes | |
| LcsClusterReader * | pScan |
| Parent cluster reader object. | |
| uint | colOrd |
| Ordinal of column in cluster (0-based). | |
| PLcsBatchDir | pBatch |
| Batch corresponding to column. | |
| PBuffer | pValues |
| Values of the batch. | |
| PBuffer | pBase |
| Base address from which offsets are stored. | |
| PtrVec | origin |
| Pointers to the origin of each bit vector. | |
| WidthVec | width |
| Width of bit vectors. | |
| uint | iV |
| PBitVecFuncPtr | pFuncReadBitVec |
| Pointer to appropriate bit vector read function. | |
| const PBuffer(LcsColumnReader::* | pGetCurrentValueFunc )() |
| Pointer to function that retrieves the current value of the column from a fixed mode batch. | |
| LcsResidualColumnFilters | filters |
| Filters associated with this column. | |
| TupleProjection | allProj |
| Projection for readerKeyData. |
Detailed Description
Reads RIDs from a single cluster.
Definition at line 35 of file LcsColumnReader.h.
Member Function Documentation
| const PBuffer LcsColumnReader::getCompressedValue | ( | | ) | [private] | | ----------------------------------------------------------------------------------------------------- | - | | - | ----------- |
| const PBuffer LcsColumnReader::getFixedValue | ( | | ) | [private] | | ------------------------------------------------------------------------------------------------ | - | | - | ----------- |
| const PBuffer LcsColumnReader::getVariableValue | ( | | ) | [private] | | --------------------------------------------------------------------------------------------------- | - | | - | ----------- |
Locates the smallest value in the compressed batch that's greater or equal to a filter predicate's bound.
Parameters:
| filterPos | index into filters.filterData |
|---|---|
| highBound | true iff called for upper bound data |
| bStrict | if true, find the entry greater than the filter predicate's bound |
| readerKeyData | TupleData used for comparison |
Returns:
index of the found entry
Definition at line 227 of file LcsColumnReader.cpp.
References allProj, LcsResidualColumnFilters::attrAccessor, TupleDescriptor::compareTuples(), LcsResidualColumnFilters::filterData, filters, getBatchValCount(), getBatchValue(), LcsResidualColumnFilters::inputKeyDesc, UnalignedAttributeAccessor::loadValue(), LcsResidualColumnFilters::lowerBoundProj, TupleDataWithBuffer::resetBuffer(), and LcsResidualColumnFilters::upperBoundProj.
Referenced by findBounds().
00232 {
00233
00234
00235
00236
00237
00238
00239
00240 uint iLo = 0, iHi = getBatchValCount(), iResult;
00241 int cmp = 0;
00242 TupleProjection &boundProj = highBound ?
00243 filters.upperBoundProj : filters.lowerBoundProj;
00244
00245
00246 while (iLo < iHi) {
00247 uint iMid = (iLo + iHi) / 2;
00248
00249 filters.attrAccessor.loadValue(
00250 readerKeyData[0],
00251 getBatchValue(iMid));
00252
00253 cmp = filters.inputKeyDesc.compareTuples(
00254 readerKeyData, allProj,
00255 filters.filterData[filterPos]->boundData, boundProj);
00256
00257
00258 readerKeyData.resetBuffer();
00259
00260 if (cmp == 0) {
00261 if (bStrict && !highBound) {
00262 iResult = iMid + 1;
00263 } else {
00264 if (!bStrict && highBound) {
00265 iResult = iMid + 1;
00266 } else {
00267 iResult = iMid;
00268 }
00269 }
00270 return iResult;
00271 } else if (cmp > 0) {
00272 iHi = iMid;
00273 } else {
00274 iLo = iMid + 1;
00275 }
00276 }
00277
00278
00279 assert(iLo == iHi);
00280 if (cmp < 0) {
00281 iResult = iHi;
00282 } else {
00283
00284 iResult = iLo;
00285 }
00286
00287 return iResult;
00288 }
| void LcsColumnReader::buildContainsMap | ( | | ) | [private] | | -------------------------------------- | - | | - | ----------- |
Initializes a scan of column "colOrdInit".
Parameters:
| pScanInit | cluster reader containing column to be initialized |
|---|---|
| colOrdInit | column number within cluster; 0-based |
Definition at line 165 of file LcsColumnReader.h.
| void LcsColumnReader::sync | ( | | ) | | -------------------------- | - | | - |
Synchronizes batches for each column when the scan moves to a new range.
Definition at line 29 of file LcsColumnReader.cpp.
References batchIsCompressed(), batchIsFixed(), bitVecPtr(), bitVecWidth(), buildContainsMap(), calcWidth(), colOrd, LcsClusterAccessBase::delta, LcsResidualColumnFilters::filteringBitmap, filters, getCompressedValue(), getFixedValue(), getVariableValue(), LcsResidualColumnFilters::hasResidualFilters, iV, LcsBatchDir::nRow, LcsBatchDir::nVal, origin, LcsBatchDir::oVal, pBase, pBatch, pFuncReadBitVec, pGetCurrentValueFunc, LcsClusterReader::pLeaf, LcsClusterReader::pRangeBatches, pScan, pValues, readBitVec0(), readBitVec1(), readBitVec10(), readBitVec12(), readBitVec16(), readBitVec2(), readBitVec3(), readBitVec4(), readBitVec5(), readBitVec6(), readBitVec8(), readBitVec9(), and width.
| bool LcsColumnReader::batchIsCompressed | ( | | ) | const [inline] | | --------------------------------------- | - | | - | ---------------- |
| bool LcsColumnReader::batchIsFixed | ( | | ) | const [inline] | | ---------------------------------- | - | | - | ---------------- |
| const PBuffer LcsColumnReader::getCurrentValue | ( | | ) | [inline] | | -------------------------------------------------------------------------------------------------- | - | | - | ---------- |
Returns current value code for a compressed batch entry.
Definition at line 199 of file LcsColumnReader.h.
| uint16_t LcsColumnReader::getCurrentValueCode | ( | | ) | const | | -------------------------------------------------------------------------------------------------- | - | | - | ----- |
| uint LcsColumnReader::getBatchValCount | ( | | ) | const [inline] | | --------------------------------------------------------------------------------------------------- | - | | - | ---------------- |
| const PBuffer LcsColumnReader::getBatchBase | ( | | ) | const [inline] | | ----------------------------------------------------------------------------------------------- | - | | - | ---------------- |
| const uint16_t* LcsColumnReader::getBatchOffsets | ( | | ) | const [inline] | | ------------------------------------------------------------------------------------------------------ | - | | - | ---------------- |
| const PBuffer LcsColumnReader::getBatchValue | ( | uint | iValCode | ) | const [inline] |
|---|
| void LcsColumnReader::readCompressedBatch | ( | uint | count, |
|---|---|---|---|
| uint16_t * | pValCodes, | ||
| uint * | pActCount | ||
| ) |
Reads up to "count" value-codes into the "pValCodes" table.
If we reach the end of the batch, "*pActCount", the number of value-codes actually read, is less than "count".
For example, if we are at rid 1000, then "pValCodes[i]" will hold the code for the value of the indexed column at rid 1000 + i. To convert this code to a value, use "GetBatchValue(pValCodes[i])".
Note: This method may be used only with compressed batches.
Parameters:
| count | how many value codes to read |
|---|---|
| pValCodes | output param for table for "count" value codes |
| pActCount | output param for actual number of value codes returned |
Definition at line 160 of file LcsColumnReader.cpp.
References LcsClusterReader::getRangePos(), LcsClusterReader::getRangeRowsLeft(), iV, min(), origin, pScan, readBitVecs(), and width.
Referenced by LbmGeneratorExecStream::generateBitmaps().
Applies the filters.
Parameters:
returns true iff the tuple passes the predicates
Definition at line 176 of file LcsColumnReader.cpp.
References TupleDescriptor::compareTuples(), LcsResidualColumnFilters::filterData, LcsResidualColumnFilters::filteringBitmap, filters, getCurrentValueCode(), LcsResidualColumnFilters::inputKeyDesc, LcsResidualColumnFilters::lowerBoundProj, LcsResidualColumnFilters::readerKeyProj, SEARCH_CLOSED_LOWER, SEARCH_CLOSED_UPPER, SEARCH_UNBOUNDED_LOWER, SEARCH_UNBOUNDED_UPPER, and LcsResidualColumnFilters::upperBoundProj.
Member Data Documentation
Pointer to function that retrieves the current value of the column from a fixed mode batch.
Referenced by sync().
The documentation for this class was generated from the following files:
- /home/pub/open/dev/fennel/lucidera/colstore/LcsColumnReader.h
- /home/pub/open/dev/fennel/lucidera/colstore/LcsColumnReader.cpp
