35 const auto tableInfo = td->
fragmenter->getFragmentsForQuery();
36 if (tableInfo.fragments.size() == 0) {
37 throw std::runtime_error(
"No fragments in table '" + td->
tableName +
"'");
41 for (
const auto& fragment : tableInfo.fragments) {
44 std::get<0>(table.back()) = 0;
47 bool isFirstColumn =
true;
48 for (
const auto& columnName : columnNames) {
52 throw std::runtime_error(
"Failed to find physical column '" + columnName +
"'");
58 auto chunkMetaIt = fragment.getChunkMetadataMap().find(cd->columnId);
59 if (chunkMetaIt == fragment.getChunkMetadataMap().end()) {
60 throw std::runtime_error(
"Failed to find the chunk for column: " +
61 cd->columnName +
" in table: " + td->
tableName +
62 ". The column was likely deleted via a table truncate.");
66 std::shared_ptr<Chunk_NS::Chunk> chunk =
72 chunkMetaIt->second->numBytes,
73 chunkMetaIt->second->numElements);
77 size_t chunkSize = chunkMetaIt->second->numElements;
80 ChunkIter chunkIt = chunk->begin_iterator(chunkMetaIt->second);
85 std::get<0>(table.back()) = chunkSize;
86 isFirstColumn =
false;
89 CHECK(std::get<0>(table.back()) == chunkSize);
91 std::get<1>(table.back()).push_back(chunk);
92 std::get<2>(table.back()).push_back(chunkIt);
99 for (
auto& entry : table) {
100 sum += std::get<0>(entry);
101 std::get<0>(entry) = sum;
std::vector< int > ChunkKey
Data_Namespace::DataMgr & getDataMgr() const
const DBMetadata & getCurrentDB() const
const ColumnDescriptor * getMetadataForColumn(int tableId, const std::string &colName) const
std::shared_ptr< Fragmenter_Namespace::AbstractFragmenter > fragmenter
std::vector< std::tuple< size_t, std::vector< std::shared_ptr< Chunk_NS::Chunk >>, ChunkIterVector >> ChunkAccessorTable
static std::shared_ptr< Chunk > getChunk(const ColumnDescriptor *cd, DataMgr *data_mgr, const ChunkKey &key, const MemoryLevel mem_level, const int deviceId, const size_t num_bytes, const size_t num_elems, const bool pinnable=true)