Joining custom metadata with S3 metadata tables - Amazon Simple Storage Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Joining custom metadata with S3 metadata tables

You can analyze data across your S3 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 S3 managed metadata table (my_s3_metadata_table) and a self-managed metadata table (my_self_managed_metadata_table). The query also filters informations 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 tables schema.)

SELECT * FROM aws_s3_metadata.my_s3_metadata_table 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';