From 2c148cff275ac33e02eed2778b1ab74c1da18e68 Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Fri, 12 Apr 2024 23:46:45 +0200 Subject: [PATCH] Apply duckdb's patch --- src/common/iceberg.cpp | 2 +- src/common/utils.cpp | 3 +-- src/iceberg_extension.cpp | 8 -------- src/iceberg_functions/iceberg_snapshots.cpp | 2 +- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/common/iceberg.cpp b/src/common/iceberg.cpp index ba2f284..db2930c 100644 --- a/src/common/iceberg.cpp +++ b/src/common/iceberg.cpp @@ -127,7 +127,7 @@ unique_ptr IcebergSnapshot::GetParseInfo(const string &path, parse_info->doc = doc; parse_info->document = std::move(metadata_json); - return std::move(parse_info); + return parse_info; } IcebergSnapshot IcebergSnapshot::GetLatestSnapshot(const string &path, FileSystem &fs, diff --git a/src/common/utils.cpp b/src/common/utils.cpp index 230a3c7..dfeebcf 100644 --- a/src/common/utils.cpp +++ b/src/common/utils.cpp @@ -7,8 +7,7 @@ namespace duckdb { string IcebergUtils::FileToString(const string &path, FileSystem &fs) { - auto handle = - fs.OpenFile(path, FileFlags::FILE_FLAGS_READ, FileSystem::DEFAULT_LOCK, FileSystem::DEFAULT_COMPRESSION); + auto handle = fs.OpenFile(path, FileFlags::FILE_FLAGS_READ); auto file_size = handle->GetFileSize(); string ret_val(file_size, ' '); handle->Read((char *)ret_val.c_str(), file_size); diff --git a/src/iceberg_extension.cpp b/src/iceberg_extension.cpp index 0e59fdc..895b79d 100644 --- a/src/iceberg_extension.cpp +++ b/src/iceberg_extension.cpp @@ -16,12 +16,6 @@ namespace duckdb { static void LoadInternal(DatabaseInstance &instance) { - Connection con(instance); - con.BeginTransaction(); - auto &context = *con.context; - - auto &catalog = Catalog::GetSystemCatalog(*con.context); - // Iceberg Table Functions for (auto &fun : IcebergFunctions::GetTableFunctions()) { ExtensionUtil::RegisterFunction(instance, fun); @@ -31,8 +25,6 @@ static void LoadInternal(DatabaseInstance &instance) { for (auto &fun : IcebergFunctions::GetScalarFunctions()) { ExtensionUtil::RegisterFunction(instance, fun); } - - con.Commit(); } void IcebergExtension::Load(DuckDB &db) { diff --git a/src/iceberg_functions/iceberg_snapshots.cpp b/src/iceberg_functions/iceberg_snapshots.cpp index ec76b42..4dd5dd7 100644 --- a/src/iceberg_functions/iceberg_snapshots.cpp +++ b/src/iceberg_functions/iceberg_snapshots.cpp @@ -117,7 +117,7 @@ TableFunctionSet IcebergFunctions::GetIcebergSnapshotsFunction() { table_function.named_parameters["metadata_compression_codec"] = LogicalType::VARCHAR; table_function.named_parameters["skip_schema_inference"] = LogicalType::BOOLEAN; function_set.AddFunction(table_function); - return std::move(function_set); + return function_set; } } // namespace duckdb