0

I'm trying to create new Iceberg table in AWS Glue:

glue_database_name = "alex_iceberg_test_db"
glue_catalog_uri = "s3://alex-iceberg-test-storage"
my_namespace = 'alex_db'


# Instantiate glue catalog
catalog = load_catalog("glue", **{"type": "glue", 
                                  "s3.region": "region", 
                                  "profile": "ALEX",
                                  "s3.access-key-id": "XXX",
                                  "s3.secret-access-key": "YYY"})


# Define the Iceberg schema
schema = Schema(
    NestedField(field_id=1, name="data", field_type=StringType(), required=False)        
)


## Create the Iceberg table using the Iceberg catalog
table_name = 'test_1'
catalog.create_table(
    identifier=f'{my_namespace}.{table_name}',
    location=glue_catalog_uri,
    schema=schema
)

and get the following error

OSError: When getting information for key 'metadata/00000-5df640cc-b47c-4b39-b578-07113565dab5.metadata.json' in bucket 'alex-iceberg-test-storage': AWS Error ACCESS_DENIED during HeadObject operation: No response body.

Inside alex-iceberg-test-storage I do have metadata but the 00000-5df640cc-b47c-4b39-b578-07113565dab5.metadata.json is not there.

Why does it searching for that file and who should create it?

1
  • are you using Boto3? Commented May 2, 2024 at 19:52

1 Answer 1

0

thanks for all the helpers! eventually what worked is to set the correct credentials in ~/.aws/credentials and then

catalog = load_catalog("glue", **{"type": "glue", 
                                  "s3.region": "us-west-2", 
                                  "profile": "my_profile
                                  })

is working correctly (even without the s3.access-key-id and s3.secret-access-key)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.