Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
bfb4324
fix: rewrite_data_files should not skip large files with delete files
Mar 10, 2026
9eea9e1
add test: rewrite_data_files should rewrite large files with delete f…
KumoSiunaus Mar 11, 2026
0cc49fe
Merge pull request #822 from KumoSiunaus/fix-rewrite-skip-large-files
Mytherin Mar 12, 2026
aaca98e
Fix race in transaction local change reads and add metadata query str…
jprafael Mar 11, 2026
7b57030
Cleanup
jprafael Mar 12, 2026
bd6a3c2
Remove guards from const methods
jprafael Mar 12, 2026
0f55a31
Make ducklake transaction read helpers const and lock-free
jprafael Mar 12, 2026
e25f7a8
Avoid AddDeletes self-deadlock during commit
jprafael Mar 12, 2026
57a8621
only delete .parquet files via ducklake_delete_orphaned_files()
c-herrewijn Mar 13, 2026
e3f5789
add test
c-herrewijn Mar 16, 2026
b7c4fe8
exclude tests from non applicable test configs
c-herrewijn Mar 16, 2026
a9d4d39
Move towards isolating table data changes
Mytherin Mar 17, 2026
5606042
Add thread-safe iterator over local changes
Mytherin Mar 17, 2026
723836c
Move cleanup files
Mytherin Mar 17, 2026
84ad698
Move methods to LocalTableChanges
Mytherin Mar 17, 2026
39d27ac
Move more code into LocalTableChanges
Mytherin Mar 17, 2026
de26207
Store partition id remaps in commit state instead of adjusting local …
Mytherin Mar 17, 2026
1f1d1b9
Store mapping id remap in commit state instead of adjusting local cha…
Mytherin Mar 17, 2026
f005b11
Fix up deletes, and make local changes members private
Mytherin Mar 17, 2026
9e8795e
Add file to ignore list
Mytherin Mar 17, 2026
c85f371
Merge pull request #829 from jprafael/jprafael/metadata_race_fix
Mytherin Mar 17, 2026
f7f2304
Merge pull request #839 from c-herrewijn/fix-delete-orphaned-files
Mytherin Mar 17, 2026
d6a4630
Fix issue when parsing table macros
pdet Mar 17, 2026
67480b1
Merge pull request #845 from pdet/parse_create_macro
Mytherin Mar 18, 2026
7addd33
Fix BeginSanpshot for tables with different schema versions
pdet Mar 18, 2026
bd9f597
Avoid flushing fully deleted inlined files
jprafael Mar 16, 2026
e44b6e8
Validate timetravel
jprafael Mar 18, 2026
0f87923
Revert "Avoid flushing fully deleted inlined files"
jprafael Mar 18, 2026
95f20cb
Allow for delete compactions to return 0 new files
jprafael Mar 18, 2026
824329a
Add reinterpret from BYTEA to Varchar for postgres inlined data
pdet Mar 18, 2026
603e42c
Merge pull request #847 from pdet/alter_column_persist
pdet Mar 18, 2026
65c48cd
Do value comparison for boolean
pdet Mar 18, 2026
6c019f4
Merge pull request #849 from pdet/reinterpret_bytea
pdet Mar 18, 2026
d0dee9c
Merge pull request #850 from pdet/prune_bool
pdet Mar 18, 2026
79d6886
Reset binding of views if binding fails
pdet Mar 19, 2026
b980548
Make merge_adjacent max option global
pdet Mar 19, 2026
fb2f179
WIP serialize ducklake_scan
pdet Mar 19, 2026
e8cedd3
Merge pull request #842 from jprafael/codex/flush-drop-fully-deleted-…
pdet Mar 19, 2026
78fbd2b
Merge pull request #855 from pdet/dangling_views
pdet Mar 19, 2026
d1a598a
Defensively update default_value_type in migration after adding the c…
pdet Mar 19, 2026
f970f1b
Merge pull request #856 from pdet/merge_max_global
pdet Mar 19, 2026
be24898
Fix inlined file deletes lost on concurrent commit retry
qsliu2017 Mar 18, 2026
588d7ff
Merge pull request #846 from qsliu2017/fix/concurent-inline-delete
pdet Mar 20, 2026
194e2c9
Merge pull request #858 from pdet/defensive_migration
pdet Mar 20, 2026
e8f195f
Cleanup separator in DATA_PATH
pdet Mar 20, 2026
75828f3
Change ducklake inlining code to handle chunks with non-physical columns
pdet Mar 20, 2026
f56fb8e
[WIP] Adds inline operator to update creation
pdet Mar 20, 2026
88acd0f
Update executing inlining
pdet Mar 20, 2026
c25fbf9
Preserve RowIds
pdet Mar 20, 2026
5fb96a2
fix deletion over inlined insertions from updates
pdet Mar 20, 2026
f670ca2
Cache existence of GetInlinedDeletionTableName
Mar 20, 2026
9bb64b4
in deletes always generate explicit row_ids
pdet Mar 20, 2026
3a8f227
we now have to flush test/sql/merge/merge_partition_update.test
pdet Mar 20, 2026
c20ee03
Fix for inserts and updates in the same transaction, as they mix row_…
pdet Mar 21, 2026
4a4320f
Merge remote-tracking branch 'upstream/v1.5-variegata' into update_in…
pdet Mar 21, 2026
e6a60a7
Cleanup
pdet Mar 21, 2026
cc91e4c
Fix issue with macro and schema being created in same transaction and…
pdet Mar 21, 2026
487cfee
small unrelated fix for alter
pdet Mar 21, 2026
ccc9177
fix: compaction should not inherit per_thread_output from lake config
Flamefork Mar 20, 2026
55ca5e9
Merge pull request #863 from pdet/separator_cleanup
pdet Mar 21, 2026
0636639
Merge pull request #872 from pdet/macro_fix
pdet Mar 21, 2026
053cda2
Merge pull request #866 from Flamefork/fix-compaction-per-thread-output
pdet Mar 23, 2026
afa97f5
Fix for merge on update-only existing data then inserting
pdet Mar 23, 2026
7ac4b2d
Some cleanup
pdet Mar 23, 2026
a71ad8c
Make update output insert chunks downstream so we can use the insert …
pdet Mar 23, 2026
9c809c0
Merge remote-tracking branch 'upstream/v1.5-variegata' into update_in…
pdet Mar 23, 2026
29cfdd7
Create PlanUpdateOperator so we can call in both update and merge into
pdet Mar 23, 2026
c89438f
Create merge update, its basically the old logic we had, copied and p…
pdet Mar 23, 2026
e391208
Fix for s3 and SET disabled_filesystems = 'LocalFileSystem'
pdet Mar 23, 2026
486bdd1
Make FinalizeCopyToInsert reusable
pdet Mar 23, 2026
478432f
Merge pull request #874 from pdet/file_system_fix
pdet Mar 23, 2026
6ab7d67
Fix merge into issues related to projections (similar to what we have…
pdet Mar 23, 2026
430f02c
Add sanity test
pdet Mar 23, 2026
7266870
woopsie
pdet Mar 23, 2026
b8c32d8
Use enum for CheckInlinedDeletionTableCache return value
Mar 24, 2026
94652f5
Merge pull request #868 from rgernhardt/robert/ducklake_cache_delete_…
pdet Mar 24, 2026
d2087ad
Merge pull request #877 from pdet/update_inline_insert
pdet Mar 24, 2026
f689aa3
Cleanup, more of serialization, remove dummy registration
pdet Mar 24, 2026
0711fae
Fix for #865
pdet Mar 24, 2026
0227733
Merge pull request #896 from pdet/ducklake_serialize
pdet Mar 24, 2026
3961cf3
Merge pull request #897 from pdet/issue_865
pdet Mar 24, 2026
9b82932
chore: merge upstream v1.5-variegata for DuckDB v1.5.1 compat
qsliu2017 Mar 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
add_library(
ducklake_common OBJECT
ducklake_data_file.cpp ducklake_name_map.cpp ducklake_types.cpp
ducklake_util.cpp parquet_file_scanner.cpp)
ducklake_data_file.cpp ducklake_name_map.cpp ducklake_snapshot.cpp
ducklake_types.cpp ducklake_util.cpp parquet_file_scanner.cpp)
set(ALL_OBJECT_FILES
${ALL_OBJECT_FILES} $<TARGET_OBJECTS:ducklake_common>
PARENT_SCOPE)
23 changes: 23 additions & 0 deletions src/common/ducklake_snapshot.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "common/ducklake_snapshot.hpp"
#include "duckdb/common/serializer/serializer.hpp"
#include "duckdb/common/serializer/deserializer.hpp"

namespace duckdb {

void DuckLakeSnapshot::Serialize(Serializer &serializer) const {
serializer.WriteProperty(100, "snapshot_id", snapshot_id);
serializer.WriteProperty(101, "schema_version", schema_version);
serializer.WriteProperty(102, "next_catalog_id", next_catalog_id);
serializer.WriteProperty(103, "next_file_id", next_file_id);
}

DuckLakeSnapshot DuckLakeSnapshot::Deserialize(Deserializer &deserializer) {
DuckLakeSnapshot result;
result.snapshot_id = deserializer.ReadProperty<idx_t>(100, "snapshot_id");
result.schema_version = deserializer.ReadProperty<idx_t>(101, "schema_version");
result.next_catalog_id = deserializer.ReadProperty<idx_t>(102, "next_catalog_id");
result.next_file_id = deserializer.ReadProperty<idx_t>(103, "next_file_id");
return result;
}

} // namespace duckdb
5 changes: 5 additions & 0 deletions src/ducklake_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "duckdb/common/exception.hpp"
#include "duckdb/common/string_util.hpp"
#include "storage/ducklake_storage.hpp"
#include "storage/ducklake_scan.hpp"
#include "functions/ducklake_table_functions.hpp"
#include "storage/ducklake_secret.hpp"
#include "duckdb/storage/storage_extension.hpp"
Expand Down Expand Up @@ -86,6 +87,10 @@ static void LoadInternal(ExtensionLoader &loader) {
DuckLakeSettingsFunction settings;
loader.RegisterFunction(settings);

// Register ducklake_scan so it can be found during deserialization
auto ducklake_scan = DuckLakeFunctions::GetDuckLakeScanFunction(loader.GetDatabaseInstance());
loader.RegisterFunction(ducklake_scan);

// secrets
auto secret_type = DuckLakeSecret::GetSecretType();
loader.RegisterSecretType(secret_type);
Expand Down
8 changes: 4 additions & 4 deletions src/functions/ducklake_add_data_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,8 @@ struct DuckLakeFileProcessor {
public:
DuckLakeFileProcessor(DuckLakeTransaction &transaction, ClientContext &context,
const DuckLakeAddDataFilesData &bind_data)
: transaction(transaction), context(context), table(bind_data.table),
allow_missing(bind_data.allow_missing), ignore_extra_columns(bind_data.ignore_extra_columns),
hive_partitioning(bind_data.hive_partitioning) {
: transaction(transaction), context(context), table(bind_data.table), allow_missing(bind_data.allow_missing),
ignore_extra_columns(bind_data.ignore_extra_columns), hive_partitioning(bind_data.hive_partitioning) {
}

vector<DuckLakeDataFile> AddFiles(const vector<string> &globs);
Expand Down Expand Up @@ -1167,7 +1166,8 @@ void DuckLakeFileProcessor::MapPartitionColumns(ParquetFileMetadata &file) {
// For YEAR/MONTH/DAY/HOUR transforms, the type is BIGINT, not the source column type
auto partition_key_type =
DuckLakePartitionUtils::GetPartitionKeyType(partition_field.transform.type, field_id->Type());
auto hive_value = HivePartitioning::GetValue(context, partition_key_name, hive_entry->second, partition_key_type);
auto hive_value =
HivePartitioning::GetValue(context, partition_key_name, hive_entry->second, partition_key_type);
file.hive_partition_values.emplace_back(
HivePartition {partition_field.field_id, partition_key_type, hive_value});
}
Expand Down
25 changes: 20 additions & 5 deletions src/functions/ducklake_compaction_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,17 @@ SourceResultType DuckLakeCompaction::GetDataInternal(ExecutionContext &context,
}
source_state.returned_result = true;

if (!this->sink_state) {
throw InternalException("DuckLakeCompaction - missing sink state while producing result");
}
auto &gstate = this->sink_state->Cast<DuckLakeInsertGlobalState>();
auto files_created = gstate.written_files.size();

chunk.SetCardinality(1);
chunk.SetValue(0, 0, Value(table.schema.name));
chunk.SetValue(1, 0, Value(table.name));
chunk.SetValue(2, 0, Value::BIGINT(static_cast<int64_t>(source_files.size())));
chunk.SetValue(3, 0, Value::BIGINT(1)); // Each compaction creates 1 output file
chunk.SetValue(3, 0, Value::BIGINT(static_cast<int64_t>(files_created)));
return SourceResultType::FINISHED;
}

Expand All @@ -121,7 +127,10 @@ SinkFinalizeType DuckLakeCompaction::Finalize(Pipeline &pipeline, Event &event,
OperatorSinkFinalizeInput &input) const {
auto &global_state = input.global_state.Cast<DuckLakeInsertGlobalState>();

if (global_state.written_files.size() != 1) {
if (global_state.written_files.size() > 1) {
throw InternalException("DuckLakeCompaction - expected at most a single output file");
}
if (global_state.written_files.empty() && type != CompactionType::REWRITE_DELETES) {
throw InternalException("DuckLakeCompaction - expected a single output file");
}
// set the partition values correctly
Expand All @@ -137,7 +146,9 @@ SinkFinalizeType DuckLakeCompaction::Finalize(Pipeline &pipeline, Event &event,
DuckLakeCompactionEntry compaction_entry;
compaction_entry.row_id_start = row_id_start;
compaction_entry.source_files = source_files;
compaction_entry.written_file = global_state.written_files[0];
if (!global_state.written_files.empty()) {
compaction_entry.written_file = global_state.written_files[0];
}
compaction_entry.type = type;

auto &transaction = DuckLakeTransaction::Get(context, global_state.table.catalog);
Expand Down Expand Up @@ -222,8 +233,9 @@ void DuckLakeCompactor::GenerateCompactions(DuckLakeTableEntry &table,
compaction_map_t<DuckLakeCompactionCandidates> candidates;
for (idx_t file_idx = 0; file_idx < files.size(); file_idx++) {
auto &candidate = files[file_idx];
if (candidate.file.data.file_size_bytes >= target_file_size) {
if (candidate.file.data.file_size_bytes >= target_file_size && type != CompactionType::REWRITE_DELETES) {
// this file by itself exceeds the threshold - skip merging
// (does not apply to REWRITE_DELETES - delete files must be rewritten regardless of data file size)
continue;
}
if ((!candidate.delete_files.empty() && type == CompactionType::MERGE_ADJACENT_TABLES) ||
Expand Down Expand Up @@ -304,6 +316,9 @@ void DuckLakeCompactor::GenerateCompactions(DuckLakeTableEntry &table,
break;
}
}
if (compacted_files >= options.max_files) {
break;
}
}
}

Expand Down Expand Up @@ -559,7 +574,7 @@ DuckLakeCompactor::GenerateCompactionCommand(vector<DuckLakeCompactionFileEntry>
copy->filename_pattern = std::move(copy_options.filename_pattern);
copy->file_extension = std::move(copy_options.file_extension);
copy->overwrite_mode = copy_options.overwrite_mode;
copy->per_thread_output = copy_options.per_thread_output;
copy->per_thread_output = false;
copy->file_size_bytes = copy_options.file_size_bytes;
copy->rotate = copy_options.rotate;
copy->return_type = copy_options.return_type;
Expand Down
5 changes: 3 additions & 2 deletions src/functions/ducklake_flush_inlined_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,9 @@ DuckLakeDataFlusher::DuckLakeDataFlusher(ClientContext &context, DuckLakeCatalog

unique_ptr<LogicalOperator> DuckLakeDataFlusher::GenerateFlushCommand() {
// get the table entry at the specified snapshot
DuckLakeSnapshot snapshot(catalog.GetBeginSnapshotForTable(table_id, transaction), inlined_table.schema_version, 0,
0);
DuckLakeSnapshot snapshot(
catalog.GetBeginSnapshotForSchemaVersion(table_id, inlined_table.schema_version, transaction),
inlined_table.schema_version, 0, 0);

auto entry = catalog.GetEntryById(transaction, snapshot, table_id);
if (!entry) {
Expand Down
6 changes: 6 additions & 0 deletions src/include/common/ducklake_snapshot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

namespace duckdb {

class Serializer;
class Deserializer;

struct DuckLakeSnapshot {
DuckLakeSnapshot(idx_t snapshot_id, idx_t schema_version, idx_t next_catalog_id, idx_t next_file_id)
: snapshot_id(snapshot_id), schema_version(schema_version), next_catalog_id(next_catalog_id),
Expand All @@ -27,6 +30,9 @@ struct DuckLakeSnapshot {
idx_t schema_version;
idx_t next_catalog_id;
idx_t next_file_id;

void Serialize(Serializer &serializer) const;
static DuckLakeSnapshot Deserialize(Deserializer &deserializer);
};

} // namespace duckdb
5 changes: 5 additions & 0 deletions src/include/common/index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ namespace duckdb {

struct DuckLakeConstants {
static constexpr const idx_t TRANSACTION_LOCAL_ID_START = 9223372036854775808ULL;
static constexpr const idx_t TRANSACTION_LOCAL_ROW_ID_START = 1000000000000000000ULL;

static bool IsTransactionLocalRowId(int64_t rid) {
return rid >= 0 && static_cast<idx_t>(rid) >= TRANSACTION_LOCAL_ROW_ID_START;
}
};

struct SchemaIndex {
Expand Down
17 changes: 17 additions & 0 deletions src/include/storage/ducklake_catalog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ struct DuckLakeConfigOption;
struct DeleteFileMap;
class LogicalGet;

enum class InlinedDeletionCacheResult { EXISTS, DOES_NOT_EXIST, UNKNOWN };

class DuckLakeCatalog : public Catalog {
public:
// default target file size: 512MB
Expand Down Expand Up @@ -57,6 +59,8 @@ class DuckLakeCatalog : public Catalog {
return metadata_type;
}
idx_t DataInliningRowLimit(SchemaIndex schema_index, TableIndex table_index) const;
//! Returns the inlining limit (0 if the table is not eligible)
idx_t GetInliningLimit(ClientContext &context, DuckLakeTableEntry &table, const vector<LogicalType> &types);
string &Separator() {
return separator;
}
Expand Down Expand Up @@ -164,12 +168,18 @@ class DuckLakeCatalog : public Catalog {
optional_ptr<const DuckLakeNameMap> TryGetMappingById(DuckLakeTransaction &transaction, MappingIndex mapping_id);
MappingIndex TryGetCompatibleNameMap(DuckLakeTransaction &transaction, const DuckLakeNameMap &name_map);
idx_t GetBeginSnapshotForTable(TableIndex table_id, DuckLakeTransaction &transaction);
idx_t GetBeginSnapshotForSchemaVersion(TableIndex table_id, idx_t schema_version, DuckLakeTransaction &transaction);

static unique_ptr<DuckLakeStats> ConstructStatsMap(vector<DuckLakeGlobalStatsInfo> &global_stats,
DuckLakeCatalogSet &schema);
//! Return the schema for the given snapshot - loading it if it is not yet loaded
DuckLakeCatalogSet &GetSchemaForSnapshot(DuckLakeTransaction &transaction, DuckLakeSnapshot snapshot);

//! Check if an inlined deletion table is known to exist or not exist for the given table and snapshot
InlinedDeletionCacheResult CheckInlinedDeletionTableCache(TableIndex table_id, DuckLakeSnapshot snapshot);
//! Cache the result of an inlined deletion table existence check
void CacheInlinedDeletionTableResult(TableIndex table_id, DuckLakeSnapshot snapshot, bool exists);

private:
void DropSchema(ClientContext &context, DropInfo &info) override;
unique_ptr<DuckLakeCatalogSet> LoadSchemaForSnapshot(DuckLakeTransaction &transaction, DuckLakeSnapshot snapshot);
Expand Down Expand Up @@ -200,6 +210,13 @@ class DuckLakeCatalog : public Catalog {
string metadata_type;
//! Whether or not the catalog is initialized
bool initialized = false;
//! Cache for inlined deletion table existence checks
mutex inlined_deletion_cache_lock;
//! Table IDs where the inlined deletion table is known to exist (permanent - never invalidated)
unordered_set<idx_t> inlined_deletion_exists;
//! Table IDs where the inlined deletion table is known to NOT exist, with the snapshot_id at which we checked
//! Valid as long as current snapshot.snapshot_id <= cached snapshot_id
unordered_map<idx_t, idx_t> inlined_deletion_not_exists;
//! The id of the last committed snapshot, set at FlushChanges on a successful commit
mutable mutex commit_lock;
optional_idx last_committed_snapshot;
Expand Down
10 changes: 10 additions & 0 deletions src/include/storage/ducklake_inlined_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ namespace duckdb {
struct DuckLakeInlinedData {
unique_ptr<ColumnDataCollection> data;
map<FieldIndex, DuckLakeColumnStats> column_stats;
//! Row Ids for update inlining
vector<int64_t> row_ids;

bool HasPreservedRowIds() const;
//! Get the row_id for a given position in the data collection
idx_t GetRowId(idx_t position) const;
//! Get the output row_id for a surviving (non-deleted) row
int64_t GetOutputRowId(idx_t position) const;
//! Merge preserved row_ids from update inlining
void MergeRowIds(const DuckLakeInlinedData &new_data, idx_t new_data_count);
};

struct DuckLakeInlinedDataDeletes {
Expand Down
2 changes: 2 additions & 0 deletions src/include/storage/ducklake_metadata_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class DuckLakeMetadataManager {
DuckLakeSnapshot snapshot,
DuckLakeFileSizeOptions options);
virtual idx_t GetBeginSnapshotForTable(TableIndex table_id);
virtual idx_t GetBeginSnapshotForSchemaVersion(TableIndex table_id, idx_t schema_version);
virtual idx_t GetNetDataFileRowCount(TableIndex table_id, DuckLakeSnapshot snapshot);
virtual idx_t GetNetInlinedRowCount(const string &inlined_table_name, DuckLakeSnapshot snapshot);
virtual vector<DuckLakeFileForCleanup> GetOldFilesForCleanup(const string &filter);
Expand Down Expand Up @@ -259,6 +260,7 @@ class DuckLakeMetadataManager {

string LoadPath(string path);
string StorePath(string path);
string GetPathSeparator(const string &path);

protected:
virtual string GetLatestSnapshotQuery() const;
Expand Down
3 changes: 2 additions & 1 deletion src/include/storage/ducklake_multi_file_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ namespace duckdb {
//! The DuckLakeMultiFileList implements the MultiFileList API to allow injecting it into the regular DuckDB parquet
//! scan
class DuckLakeMultiFileList : public MultiFileList {
static constexpr const idx_t TRANSACTION_LOCAL_ID_START = 1000000000000000000ULL;
static constexpr const char *DUCKLAKE_TRANSACTION_LOCAL_INLINED_FILENAME =
"__ducklake_inlined_transaction_local_data";

Expand Down Expand Up @@ -63,6 +62,8 @@ class DuckLakeMultiFileList : public MultiFileList {
void GetFilesForTable() const;
void GetTableInsertions() const;
void GetTableDeletions() const;
//! Get the row_id_start for transaction-local inlined data.
idx_t GetTransactionLocalRowIdStart(idx_t transaction_row_start) const;

private:
mutable mutex file_lock;
Expand Down
10 changes: 10 additions & 0 deletions src/include/storage/ducklake_scan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace duckdb {
class DuckLakeMultiFileList;
class DuckLakeTableEntry;
class DuckLakeTransaction;
class Serializer;
class Deserializer;

class DuckLakeFunctions {
public:
Expand All @@ -28,11 +30,19 @@ class DuckLakeFunctions {
static CopyFunctionCatalogEntry &GetCopyFunction(ClientContext &context, const string &name);
};

//! Serialize/Deserialize callbacks for DuckLakeScan (used by table macro Copy)
void DuckLakeScanSerialize(Serializer &serializer, const optional_ptr<FunctionData> bind_data,
const TableFunction &function);
unique_ptr<FunctionData> DuckLakeScanDeserialize(Deserializer &deserializer, TableFunction &function);

enum class DuckLakeScanType { SCAN_TABLE, SCAN_INSERTIONS, SCAN_DELETIONS, SCAN_FOR_FLUSH };

struct DuckLakeFunctionInfo : public TableFunctionInfo {
DuckLakeFunctionInfo(DuckLakeTableEntry &table, DuckLakeTransaction &transaction, DuckLakeSnapshot snapshot);

static shared_ptr<DuckLakeFunctionInfo> Create(DuckLakeTableEntry &table, DuckLakeTransaction &transaction,
DuckLakeSnapshot snapshot);

DuckLakeTableEntry &table;
weak_ptr<DuckLakeTransaction> transaction;
string table_name;
Expand Down
2 changes: 1 addition & 1 deletion src/include/storage/ducklake_stats.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class BaseStatistics;

//! Returns true for types that require value-based (not lexicographic string) comparison for min/max stats
inline bool RequiresValueComparison(const LogicalType &type) {
return type.IsNumeric() || type.IsTemporal();
return type.IsNumeric() || type.IsTemporal() || type.id() == LogicalTypeId::BOOLEAN;
}

struct DuckLakeColumnStats;
Expand Down
Loading
Loading