- Newest
- Most votes
- Most comments
It seems like you are trying to query DynamoDB directly from Athena, but you must have the Athena-DynamoDB connector in place before you can do that, as discussed in this answer: https://repost.aws/questions/QU_iNc9D56SQC_8N30bMVUOQ/hive-unknown-error-java-net-urisyntaxexception-relative-path-in-absolute-uri-arn-aws-dynamodb-us-east-1-account-id-table-mytable#ANxOWaMnlHTE-1woUY1lOjCA
Keep in mind, Athena queries coming through the connector will consume read capacity units on the table, which could possibly impact your production traffic.
You could also use (Do not consume capacity from DynamoDB):
- DynamoDB Zero ETL to SageMaker LakeHouse which will sync your data in parquet files on S3, which would be an excellent fit for Athena
- Should it be a one time job, or the staleness of the data doesn't matter you can Export your DynamoDB data to S3, allowing you to again Query directly from Athena.
To query DynamoDB tables using Athena, you need to use the Athena DynamoDB connector, which isn't automatically set up when you create a Glue crawler for a DynamoDB table.
The error you're seeing occurs because Athena is trying to interpret the DynamoDB ARN as a file path, which it cannot process directly. Standard Glue crawlers can catalog DynamoDB tables, but Athena needs a special connector to query them.
Here's what you need to do:
1. Deploy the Athena DynamoDB connector from the AWS Serverless Application Repository. This connector uses a Lambda function to query data in DynamoDB.
2. After deploying the connector, create a data source in Athena that points to your DynamoDB table.
3. Make sure the Lambda function and Athena spill bucket are in the same AWS region.
4. Ensure your Query Result Location is properly set in Athena.
5. Once the connector is set up, you'll need to query using the data source name you created, not directly against the Glue database table.
The connector has some limitations with schema inference, so you might need to edit the table properties in AWS Glue to properly enable them for use with DynamoDB. This includes adding the "dynamodb" string to the table properties under the "classification" field and specifying the source table name.
Remember that the Athena DynamoDB connector only recognizes lowercase table and column names when migrated to Glue Catalog.
Sources
HIVE_UNKNOWN_ERROR: java.net.URISyntaxException: Relative path in absolute URI: arn:aws:dynamodb:us-east-1:<account-id>:table/mytable | AWS re:Post
Query Amazon DynamoDB tables with SQL by using Amazon Athena - AWS Prescriptive Guidance
Amazon Athena DynamoDB connector - Amazon Athena
Relevant content
- AWS OFFICIALUpdated 5 years ago
