TABLE_NOT_FOUND on Athena query with SQL Server using Lambda and JDBC

0

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 ?

SQL server is on premise.

已提問 1 年前檢視次數 1014 次
2 個答案
0
已接受的答案

This was a user rights issue : 1°) SQL Server username needs to have usermapping with db_datareader & public on SQL Server database 2°) SQL Server username used by Lambda function should be able to read in table : SYS.DM_DB_PARTITION_STATS :

USE [database_name];
GRANT VIEW DATABASE STATE TO [user_name];

3°) maque sure that schema to be read (ex : "dbo") has issqluser column value at "1" in table : sys.sysusers

已回答 1 年前
profile pictureAWS
專家
已審閱 1 年前
0

it may be related with the JDBC Driver you are using or the Connection String try to write queries like database.schema.tablename for SQL Server like database.dbo.tbl_name

profile picture
專家
已回答 1 年前
  • Ni Sedat, just a SQL server user rights issue.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南