Joining custom metadata with S3 metadata tables - Amazon Simple Storage Service
Services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the AWS European Sovereign Cloud Region, see the AWS European Sovereign Cloud User Guide.

Joining custom metadata with S3 metadata tables

You can analyze data across your AWS managed metadata tables and customer (self-managed) metadata tables. By using a standard SQL JOIN operator, you can query data from these multiple sources.

The following example SQL query finds matching records between an AWS managed journal table ("journal") and a self-managed metadata table (my_self_managed_metadata_table). The query also filters information based on CREATE events, which indicate that a new object (or a new version of the object) was written to the bucket. (For more information, see the S3 Metadata journal tables schema.)

SELECT * FROM "s3tablescatalog/aws-s3"."b_general-purpose-bucket-name"."journal" a JOIN "my_namespace"."my_self_managed_metadata_table" b ON a.bucket = b.bucket AND a.key = b.key AND a.version_id = b.version_id WHERE a.record_type = 'CREATE';

The following example SQL query finds matching records between an AWS managed inventory table ("inventory") and a self-managed metadata table (my_self_managed_metadata_table):

SELECT * FROM "s3tablescatalog/aws-s3"."b_general-purpose-bucket-name"."inventory" a JOIN "my_namespace"."my_self_managed_metadata_table" b ON a.bucket = b.bucket AND a.key = b.key AND a.version_id = b.version_id;