Skip to content

HIVE_UNKNOWN_ERROR: java.net.URISyntaxException: Relative path in absolute URI: arn:aws:dynamodb:us-east-1:<account-id>:table/mytable

0

I have created a dynamodb table that stores some data, then created a glue crawler that crawls to store the metadata of this table so I can query it using Athena. I am seeing the dynamodb table got created and stored my data, and the crawler created the table, but when I do:

SELECT * FROM mytable LIMIT 10;

I get:

HIVE_UNKNOWN_ERROR: java.net.URISyntaxException: Relative path in absolute URI: arn:aws:dynamodb:us-east-1:<account-id>:table/mytable

I found some people asking similar questions, but they're either unanswered or got answers that did not work for me. For instance, one recommended adding the 'catalog name'.'database'.'table name' to the query instead of just mentioning the table name, but this returned the same error.

Does AWS Athena support querying tables that point to non-S3 as data-source? if so, how to get past this error?

asked 2 years ago898 views

2 Answers
2
Accepted Answer

You need to use the Athena-DynamoDB connector to query data sitting on DynamoDB. The following prescriptive guidance can help you set it up quickly: https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/access-query-and-join-amazon-dynamodb-tables-using-athena.html

The connector uses an AWS Lambda function to query the data in DynamoDB. You don’t need to write any code to set up the connection. After the connection is established, you can quickly access and analyze DynamoDB tables by using Athena Federated Query to run SQL commands from Athena. You can also join one or more DynamoDB tables to each other or to other data sources, such as Amazon Redshift or Amazon Aurora.

Enter image description here

AWS
EXPERT

answered 2 years ago

0

Yes, AWS Athena does support querying tables that point to non-S3 data sources, including DynamoDB tables. However, the error you're encountering suggests there might be an issue with how the table is configured or how Athena is trying to access the DynamoDB table.

To query a DynamoDB table using Athena, you need to use the Athena DynamoDB connector. This connector allows Athena to read data directly from DynamoDB tables. However, the connector has some limitations in schema inference, which might be causing the issue you're experiencing.

To resolve this problem, you can try the following steps:

  1. Ensure that you're using the latest version of the Athena DynamoDB connector.

  2. Double-check that the AWS Glue crawler has correctly inferred the schema of your DynamoDB table. Review the discovered schema in the AWS Glue Data Catalog to make sure it accurately represents your DynamoDB table structure.

  3. Use the "columnMapping" property in your table definition to prevent missing data columns. This can help address issues with schema inference.

  4. Verify that the table name, database name, and column names in your Glue Data Catalog don't exceed 255 characters and only contain lowercase letters, numbers, and underscores.

  5. Make sure that the data types in your DynamoDB table are compatible with Athena. If there are incompatible data types, you may need to modify the table definition in the Glue Data Catalog to use compatible types.

  6. Check that your IAM permissions are correctly set up to allow Athena to access both the Glue Data Catalog and the DynamoDB table.

If these steps don't resolve the issue, you may need to recreate the table in the Glue Data Catalog using a custom table definition that explicitly maps the DynamoDB table structure to a format that Athena can query.

Remember that querying DynamoDB tables through Athena may have performance implications, especially for large tables or complex queries. It's often more efficient to query DynamoDB directly using its native APIs for most use cases.
Sources
Troubleshoot "Column not found" error in Athena DynamoDB connector | AWS re:Post
Troubleshoot "ResourceNotFoundException" error in DynamoDB | AWS re:Post

answered 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.