Querying S3 tables bucket from Athena

0

Hi, I have created Iceberg table in S3 table bucket and trying to select the table history from Athena.

I am using query select * from "new_namespace.new_test_table".history and getting following error HIVE_METASTORE_ERROR: Unknown exception occurred. (Service: AWSGlue; Status Code: 400; Error Code: FederationSourceException; Request ID: 79d8247d-acb6-46f2-8e04-1ab4659451d6; Proxy: null) This query ran against the "new_namespace" database, unless qualified by the query.

is there a way to query s3 tables bucket iceberg table for history

asked 2 months ago127 views
1 Answer
0

Yes, there is a way to query S3 tables bucket Iceberg table for history, but it seems you're encountering an error due to incorrect query syntax or permissions issues. When querying S3 tables using Athena, there are a few important points to consider:

  1. Catalog specification: You need to specify the correct catalog for S3 Tables. Instead of using the default Glue catalog, you should use 's3tablescatalog' as the catalog name.

  2. Query syntax: The correct syntax for querying an S3 table in Athena should include the catalog name, namespace (database), and table name.

  3. Permissions: Ensure you have the necessary Lake Formation permissions to access the table.

Try modifying your query to something like this:

SELECT * FROM "s3tablescatalog"."new_namespace"."new_test_table$history"

Note the use of 's3tablescatalog' as the catalog name and the '$history' suffix to access the table history.

If you still encounter issues, verify that:

  1. You have integrated your S3 table buckets with AWS analytics services.
  2. You have the correct Lake Formation permissions on the table.
  3. You have registered the S3 table bucket catalog as a data source in Athena.

If the problem persists, you may need to check with AWS support or review your Lake Formation and Athena configurations to ensure everything is set up correctly for querying S3 Tables.
Sources
Tutorial: Getting started with S3 Tables - Amazon Simple Storage Service
Querying Amazon S3 tables with Athena - Amazon Simple Storage Service
S3 Tables - Unable to query using Athena | AWS re:Post

profile picture
answered 2 months 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.

Guidelines for Answering Questions