Skip to content

Commit

Permalink
create shortcut 7970
Browse files Browse the repository at this point in the history
  • Loading branch information
nadavsteindler committed Jul 21, 2024
1 parent 16fec21 commit d9924c0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/actions/lua/lakefs/catalogexport/glue_exporter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ end
- table_name(string): override default glue table name
- debug(boolean)
- export_base_uri(string): override the default prefix in S3 for symlink location i.e s3://other-bucket/path/
- create_nonexistant_db(boolean): if the db doesn't exist, creates it
]]
local function export_glue(glue, db, table_src_path, create_table_input, action_info, options)
local opts = options or {}
Expand All @@ -127,6 +128,11 @@ local function export_glue(glue, db, table_src_path, create_table_input, action_
error("table " .. descriptor.type .. " in path " .. table_src_path .. " not supported")
end

local create_db = opts.create_nonexistant_db or false
if create_db then
glue.create_database(db) -- may fail if db doesn't exist
end

-- finallize create glue table input
local table_input = build_glue_create_table_input(create_table_input, descriptor, symlink_location, columns,
partitions, action_info, opts)
Expand Down

0 comments on commit d9924c0

Please sign in to comment.