3

I am trying to query my athena database using

import awswrangler as wr  
df = wr.athena.read_sql_query(sql="""SELECT * FROM tablename limit 10;"""
                              , database="databasename"
                             ,data_source='AwsDataCatalog')

but I keep getting this error

QueryFailed: SYNTAX_ERROR: line 7:3: Schema xyz does not exist. You may need to manually clean the data at location 's3://aws-athena-query-results-2841094621-us-east-1/tables/e29380fa-66dd-4939-b675-00e80fddd5ff' before retrying. Athena will not delete data in your account.

Is this because of the region information?  
Devarshi Goswami
  • 1,035
  • 4
  • 11
  • 26
  • what is this schema vaultron_target? do you have such a schema in this region and workgroup? – HagaiA Jan 04 '23 at 08:51

1 Answers1

0

Before running the query, you should set the session according to the desired region (where your Athena instance is located):

import boto3
boto3.setup_default_session(region_name='your_region')
HagaiA
  • 193
  • 3
  • 15