Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query error even if table exists #44

Closed
aastha-agrawal-1 opened this issue May 25, 2020 · 6 comments
Closed

Query error even if table exists #44

aastha-agrawal-1 opened this issue May 25, 2020 · 6 comments

Comments

@aastha-agrawal-1
Copy link

I am trying to run a SQL command on a table in Athena but it raise an error table not found even if the table exist in the database. Could you please resolve it?

@heruscode
Copy link

+1

is this a problem? or we need to use something like "use 'database'" in SQL?

@dacort
Copy link
Owner

dacort commented May 27, 2020

You'll need to specify the full database and table in your SQL queries.

This is behavior of the Athena JDBC driver.

By default, the driver queries the default database. To distinguish between tables
in the default and custom databases, when writing your queries, use the database
identifier as a namespace prefix to your table name.

@dacort dacort closed this as completed May 27, 2020
@orenmazor
Copy link

is there any way to specify a default database?

@dacort
Copy link
Owner

dacort commented Jul 20, 2020

Try adding Schema in the additional connection string options, e.g: Schema=somedb

@orenmazor
Copy link

fantastic. thank you. I keep meaning to see what the full spec of those options is. is there a doc somewhere in aws?

@dacort
Copy link
Owner

dacort commented Jul 20, 2020

It’s in the installation and configuration guide: https://s3.amazonaws.com/athena-downloads/drivers/JDBC/SimbaAthenaJDBC_2.0.9/docs/Simba+Athena+JDBC+Driver+Install+and+Configuration+Guide.pdf

(Note it’s version-specific)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants