By using AWS re:Post, you agree to the Terms of Use
/INVALID_INPUT in Athena Query/

INVALID_INPUT in Athena Query

0

I configured an Athena-DynamoDB-connector and tried a first query. In the query editor I selected a datasource and a database and then the list of tables is shown. When I run the query the result is INVALID_INPUT without any further specification of the invalid input. Can somebody help me?

asked 3 months ago4 views
5 Answers
0

Hello,

To configure the Athena connector you will need to first deploy the SAM application provided on this github repository, you have two options, one to build the solution from scratch yourself following the procedure listed here or to deploy the lambda function using the Serverless app repository. For the second option, you just navigate in the AWS console, select lambda and then create new function, at the right you will find "Browse Serverless app repository" if you type in the search box AthenaDynamoDBConnector and check the box "Show apps that create custom IAM roles or resource policies" You will find the pre-build application. Once you deploy this application You have to navigate to the AWS console to Athena, Select data sources at the left side and create a new one, select the lambda function that was just deployed and hit Save.

Finally in your query editor, you can now select the DataSource just configured, select the default database and you should be able to see the DynamoDB tables you have in your account (If your role has the right permissions). Just to test out, select one of the tables (the 3 dots at the right side of the table name, click "Preview Table" and you should be able to see your table information.

Before running athena queries you should enable the s3 bucket to store the query results.

Try the procedure and let me know if that works, usually the most issues with this integrations are done in the build of the connector if you are building the connector from scratch.

Thanks for reading.

answered 3 months ago
0

Hi, First of all I want to say that I appreciate it to spend time on my question. Thank you very much. I followed your instructions and took the second option: After typing "AthenaDynamoDBConnector" in the search box and checking the box "Show apps that create custom IAM roles or resource policies" I see two options: 1. AthenaDynamoDBConnector, Creates custom IAM roles or resource policies Added https://github.com/awslabs/aws-athena-query-federation/pull/375 This connector enables Amazon Athena to communicate with DynamoDB, making your tables accessible via SQL. default author 263 deployments 2. AthenaDynamoDBConnector, Creates custom IAM roles or resource policies This connector enables Amazon Athena to communicate with DynamoDB, making your tables accessible via SQL. Amazon Athena Federation 10.3K deployments

I started choosing option 2 because this option has been chosen by more than 10k users. When I choose this second option then after deploying I will see “serverlessrepo-AthenaDynamoDBConnector” in the list of Applications instead of the list of functions. The result is that when defining the datasource I cannot select the lambda function. I also saw in the status of the application “Update rollback completed”

Then I deleted the application via “Visit the AWS CloudFormation console to delete your application stack.” and tried option 1. In that case the catalog name is shown in the list of lambda functions with “Java 8 on Amazon Linux 1” as Runtime. Then I’m able to define the datasource in Athena and to select the catalog name as lambda function. When I try to run a query I see the error “INVALID_INPUT’. I’m using this in eu-west-1. Could that be the problem? Kind regards Reyer

answered 3 months ago
0

It could be permissions, on your account, without the exact error would be difficult for me to tell you exactly where is the problem.

In my case when I deploy the SAM application, I will find on the name "serverlessrepo-AthenaDynamoDBConnector" and then when I click on it I can see it deployed, a lambda function, a role and a policy.

Then I deleted the application via “Visit the AWS CloudFormation console to delete your application stack.” and tried option 1. In that case the catalog name is shown in the list of lambda functions with “Java 8 on Amazon Linux 1” as Runtime. Then I’m able to define the datasource in Athena and to select the catalog name as lambda function. When I try to run a query I see the error “INVALID_INPUT’. I’m using this in eu-west-1. Could that be the problem? Kind regards Reyer

It could be, The newer package uses Java11.

answered 3 months ago
0

without the exact error would be difficult for me to tell you exactly where is the problem

Can you help me finding the exact error message? I only see "INVALID_INPUT".

answered 3 months ago
0

I found the cause and the solution! In the query settings there was a wrong value in the 'Expected bucket owner' field for the result bucket.

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