-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c513156
commit f973095
Showing
9 changed files
with
186 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
aws-glue-libs | ||
Copyright 2016-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
Copyright 2016-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
class DataFrameWriter(object): | ||
def __init__(self, glue_context): | ||
self._glue_context = glue_context | ||
def from_catalog(self, frame, database=None, table_name=None, redshift_tmp_dir="", transformation_ctx="", | ||
additional_options={}, catalog_id=None, **kwargs): | ||
"""Writes a DataFrame with the specified catalog name space and table name. | ||
""" | ||
if database is not None and "name_space" in kwargs: | ||
raise Exception("Parameter name_space and database are both specified, choose one.") | ||
elif database is None and "name_space" not in kwargs: | ||
raise Exception("Parameter name_space or database is missing.") | ||
elif "name_space" in kwargs: | ||
db = kwargs.pop("name_space") | ||
else: | ||
db = database | ||
|
||
if table_name is None: | ||
raise Exception("Parameter table_name is missing.") | ||
|
||
return self._glue_context.write_data_frame_from_catalog(frame, db, table_name, redshift_tmp_dir, | ||
transformation_ctx, additional_options, catalog_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.