TABLE_NOT_FOUND on Athena query with SQL Server using Lambda and JDBC

uqjltbpv  于 2023-06-21  发布在  SQL Server
关注(0)|答案(1)|浏览(142)

I'm using federated queries in AWS Athena, querying data on SQL server.

When Connecting to Athena, I am able to visualise, the list of tables and their schema. (show tables & describe [Table Name] are working) But getting error TABLE_NOT_FOUND when running select queries.

Why ?

xfb7svmp

xfb7svmp1#

SOLVED. This was a user rights issue:

  1. The SQL Server user account needs to have a user mapping with db_datareader and public roles on the SQL Server database
  2. The SQL Server account used by the Lambda function should be able to read the SYS.DM_DB_PARTITION_STAT table.

SOURCE:https://github.com/awslabs/aws-athena-query-federation/blob/master/athena-sqlserver/src/main/java/com/amazonaws/athena/connectors/sqlserver/SqlServerMetadataHandler.java

相关问题