Skip to content

Commit

Permalink
Apply duckdb's patch
Browse files Browse the repository at this point in the history
  • Loading branch information
carlopi committed Apr 12, 2024
1 parent 5a6b6e7 commit 2c148cf
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/common/iceberg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ unique_ptr<SnapshotParseInfo> 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,
Expand Down
3 changes: 1 addition & 2 deletions src/common/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 0 additions & 8 deletions src/iceberg_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg_functions/iceberg_snapshots.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2c148cf

Please sign in to comment.