2626#include " storage/ducklake_delete.hpp"
2727#include " storage/ducklake_delete_filter.hpp"
2828#include " duckdb/common/types/blob.hpp"
29+ #include " common/ducklake_util.hpp"
2930#include " functions/ducklake_compaction_functions.hpp"
3031#include " storage/ducklake_sort_data.hpp"
3132
@@ -420,6 +421,7 @@ static void FlushInlinedFileDeletions(ClientContext &context, DuckLakeCatalog &c
420421 auto &metadata_manager = transaction.GetMetadataManager ();
421422 auto table_id = table.GetTableId ();
422423 auto snapshot = transaction.GetSnapshot ();
424+ auto &fs = FileSystem::GetFileSystem (context);
423425
424426 // Check if this table has an inlined deletion table
425427 auto inlined_table_name = metadata_manager.GetInlinedDeletionTableName (table_id, snapshot);
@@ -466,7 +468,9 @@ LEFT JOIN (
466468 if (file_info.file_path .empty ()) {
467469 auto path = chunk->GetValue (1 , row_idx).GetValue <string>();
468470 auto path_is_relative = chunk->GetValue (2 , row_idx).GetValue <bool >();
469- file_info.file_path = path_is_relative ? table.DataPath () + path : path;
471+ file_info.file_path = path_is_relative
472+ ? DuckLakeUtil::JoinPath (fs, table.DataPath (), path)
473+ : path;
470474 file_info.max_snapshot = begin_snapshot;
471475
472476 // Check for existing delete file
@@ -503,7 +507,6 @@ LEFT JOIN (
503507 }
504508
505509 // Write delete files
506- auto &fs = FileSystem::GetFileSystem (context);
507510 vector<DuckLakeDeleteFile> delete_files;
508511
509512 // Get encryption key if the catalog is encrypted
@@ -527,7 +530,10 @@ LEFT JOIN (
527530 // Read existing deletions from the delete file
528531 DuckLakeFileData existing_delete_file_data;
529532 existing_delete_file_data.path = file_info.existing_delete_path_is_relative
530- ? table.DataPath () + file_info.existing_delete_path
533+ ? DuckLakeUtil::JoinPath (
534+ fs,
535+ table.DataPath (),
536+ file_info.existing_delete_path )
531537 : file_info.existing_delete_path ;
532538 existing_delete_file_data.encryption_key = file_info.existing_delete_encryption_key ;
533539 existing_delete_file_data.format = file_info.existing_delete_format ;
@@ -562,7 +568,10 @@ LEFT JOIN (
562568 delete_file.overwrites_existing_delete = true ;
563569 delete_file.overwritten_delete_file .delete_file_id = file_info.existing_delete_file_id ;
564570 delete_file.overwritten_delete_file .path = file_info.existing_delete_path_is_relative
565- ? table.DataPath () + file_info.existing_delete_path
571+ ? DuckLakeUtil::JoinPath (
572+ fs,
573+ table.DataPath (),
574+ file_info.existing_delete_path )
566575 : file_info.existing_delete_path ;
567576 }
568577
0 commit comments