2개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
Hello,
I tried to purge the table and reload but unable to reload the table. Could you please share the purge_table command you are using for us to test ? Also, we recommend you to please open a support ticket with us so that we can get on a screen-share and assist you by checking your Lake Formation configuration and parameters used.
0
In my POC to work with a clean LF table, I do the following:
import awswrangler as wr
# delete table if exists
wr.catalog.delete_table_if_exists(database=DATABASE, table=TABLE)
# clean up S3 location (delete_table do not remove data itself, just a metadata)
wr.s3.delete_objects(TABLE_LOCATION)
#Create a test table
wr.catalog.create_parquet_table(
database=DATABASE,
path=TABLE_LOCATION,
table=TABLE,
partitions_types = partition_types,
columns_types=columns_types,
description='Table for testing lakeformation',
table_type = "GOVERNED",
compression= 'snappy'
)
답변함 일 년 전
관련 콘텐츠
- AWS 공식업데이트됨 일 년 전
Thanks for your reply. See below. I'll also open a support ticket. Thank you
dest_path = <s3 path> db = <database name> tbl = <table name>
tx_id = glue_context.start_transaction(False)
sink = glue_context.getSink( connection_type="s3", path=dest_path, enableUpdateCatalog=True, transactionId=tx_id ) sink.setFormat("glueparquet") sink.setCatalogInfo( catalogDatabase=db, catalogTableName=tbl )
try: glue_context.purge_table(db, tbl, options={'transactionId':tx_id}) sink.writeFrame(glue_data_frame) glue_context.commit_transaction(tx_id) except Exception: glue_context.cancel_transaction(tx_id) raise job.commit()