MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / getNumFlatTuples

Method getNumFlatTuples

src/processor/result/factorized_table.cpp:268–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266}
267
268uint64_t FactorizedTable::getNumFlatTuples(ft_tuple_idx_t tupleIdx) const {
269 std::unordered_map<uint32_t, bool> calculatedGroups;
270 uint64_t numFlatTuples = 1;
271 auto tupleBuffer = getTuple(tupleIdx);
272 for (auto i = 0u; i < tableSchema.getNumColumns(); i++) {
273 auto column = tableSchema.getColumn(i);
274 auto groupID = column->getGroupID();
275 if (!calculatedGroups.contains(groupID)) {
276 calculatedGroups[groupID] = true;
277 numFlatTuples *= column->isFlat() ? 1 : ((overflow_value_t*)tupleBuffer)->numElements;
278 }
279 tupleBuffer += column->getNumBytes();
280 }
281 return numFlatTuples;
282}
283
284uint8_t* FactorizedTable::getTuple(ft_tuple_idx_t tupleIdx) const {
285 DASSERT(tupleIdx < numTuples);

Callers 2

getNextMethod · 0.80
resetStateMethod · 0.80

Calls 6

getColumnMethod · 0.80
getGroupIDMethod · 0.80
getNumBytesMethod · 0.80
getNumColumnsMethod · 0.45
containsMethod · 0.45
isFlatMethod · 0.45

Tested by

no test coverage detected