Skip to content

Commit

Permalink
use a writer_client function instead of a storage client when passed …
Browse files Browse the repository at this point in the history
…to the export_delta_log function
  • Loading branch information
Jonathan-Rosenberg committed Dec 3, 2023
1 parent 178107d commit a687c91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/hooks/delta_lake_S3_export.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ local delta_export = require("lakefs/catalogexport/delta_exporter")
local sc = aws.s3_client(args.aws.aws_access_key_id, args.aws.aws_secret_access_key, args.aws.aws_region)

local delta_client = delta_export.get_delta_client(args.lakefs.access_key_id, args.lakefs.secret_access_key, args.aws.aws_region)
local delta_table_locations = delta_export.export_delta_log(action, args.table_paths, sc, delta_client)
local delta_table_locations = delta_export.export_delta_log(action, args.table_paths, sc.put_object, delta_client)
for t, loc in pairs(delta_table_locations) do
print("Delta Lake exported table \"" .. t .. "\"'s location: " .. loc .. "\n")
end
7 changes: 3 additions & 4 deletions pkg/actions/lua/lakefs/catalogexport/delta_exporter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@ end
table_paths: ["path/to/table1", "path/to/table2", ...]
storage_client:
- put_object: function(bucket, key, data)
write_object: function(bucket, key, data)
delta_client:
- get_table: function(repo, ref, prefix)
]]
local function export_delta_log(action, table_paths, storage_client, delta)
local function export_delta_log(action, table_paths, write_object, delta)
local repo = action.repository_id
local commit_id = action.commit_id

Expand Down Expand Up @@ -129,7 +128,7 @@ local function export_delta_log(action, table_paths, storage_client, delta)
table_entry_string = table_entry_string .. content_entry
end
local version_key = storage_props.key .. "/" .. entry_version
storage_client.put_object(storage_props.bucket, version_key, table_entry_string)
write_object(storage_props.bucket, version_key, table_entry_string)
end
response[t_name] = table_physical_path
end
Expand Down

0 comments on commit a687c91

Please sign in to comment.