1#include "duckdb/storage/checkpoint/table_data_reader.hpp"
2#include "duckdb/storage/meta_block_reader.hpp"
3#include "duckdb/common/types/null_value.hpp"
4
5#include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp"
6
7#include "duckdb/planner/parsed_data/bound_create_table_info.hpp"
8
9#include "duckdb/main/database.hpp"
10
11namespace duckdb {
12
13TableDataReader::TableDataReader(MetaBlockReader &reader, BoundCreateTableInfo &info) : reader(reader), info(info) {
14 info.data = make_uniq<PersistentTableData>(args: info.Base().columns.LogicalColumnCount());
15}
16
17void TableDataReader::ReadTableData() {
18 auto &columns = info.Base().columns;
19 D_ASSERT(!columns.empty());
20
21 // deserialize the total table statistics
22 info.data->table_stats.Deserialize(source&: reader, columns);
23
24 // deserialize each of the individual row groups
25 info.data->row_group_count = reader.Read<uint64_t>();
26 info.data->block_id = reader.block->BlockId();
27 info.data->offset = reader.offset;
28}
29
30} // namespace duckdb
31