Skip to content

Few records in S3 Metadata

0

Hello,

I've used Management Console, S3 Metadata - Preview -> Create a metadata configuration option to create a metadata table in a table bucket. The table was successfully created.

I used Spark, on localhost, to use Amazon S3 Tables Catalog for Apache Iceberg, using the following commands

spark-shell 
--packages org.apache.iceberg:iceberg-spark-runtime-3.5_2.12:1.6.1,software.amazon.s3tables:s3-tables-catalog-for-iceberg-runtime:0.1.3,software.amazon.awssdk:bundle:2.29.43 
--conf spark.sql.catalog.s3tablesbucket=org.apache.iceberg.spark.SparkCatalog 
--conf spark.sql.catalog.s3tablesbucket.catalog-impl=software.amazon.s3tables.iceberg.S3TablesCatalog 
--conf spark.sql.catalog.s3tablesbucket.warehouse=<arn:aws:s3tables:us-east-1:111122223333:bucket/amzn-s3-demo-bucket1>
--conf spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions

scala> spark.sql(" SELECT count(*) FROM s3tablesbucket.my_namespace.`my_table` ").show()

But, even if the bucket has 40 000 objects, the above count returns only 44 records in Metadata table. Shouldn't all objects have a record in metadata table ?

Thank you

asked 2 years ago208 views

1 Answer
0
Accepted Answer

The behavior you're observing is expected and aligns with how Amazon S3 Metadata works. S3 Metadata doesn't automatically capture metadata for objects that existed in your general purpose bucket before you created the metadata table configuration. It only captures metadata for change events (such as uploads, updates, and deletes) that occur after you've set up the metadata table configuration.

In your case, if you have 40,000 objects in your bucket but only 44 records in the metadata table, it suggests that only 44 objects have been added, updated, or deleted since you created the metadata table configuration. The pre-existing objects are not automatically included in the metadata table.

To have metadata for all objects in your bucket, you would need to either:

  1. Create the metadata table configuration before adding any objects to the bucket.
  2. Perform an action (like a copy-in-place operation) on the existing objects after creating the metadata table configuration, which would trigger metadata capture for those objects.

It's important to note that S3 Metadata is designed to reflect the latest changes to your data, updating the metadata table within minutes of any changes to the bucket. However, it does not retroactively capture metadata for objects that were already in the bucket when the configuration was created.

If you need metadata for all objects, including those that existed before the metadata table configuration, you might need to consider alternative approaches or wait for potential future enhancements to the S3 Metadata feature.
Sources
Accelerating data discovery with S3 Metadata - Amazon Simple Storage Service
Configuring metadata tables - Amazon Simple Storage Service
Announcing Amazon S3 Metadata (Preview) – Easiest and fastest way to manage your metadata - AWS

answered 2 years ago

AWS
EXPERT

reviewed 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.