Athena queries against mongodb

0

Hi,

I believe one can run Athena queries against a MongoDB instance using the DocumentDb connector. I've setup a connection and Athena able to read the collections within my database.

When trying to run any query, I get an error like the one below. This happens even when I use the "Preview Table" query. One thing I noticed straight away in the error message is that, even though I type my collection name with a starting capital letter (e.g. User) in my query, it's getting reported back in the error in all lowercase (e.g. "user").

My example table name

User

Here is a sample query (fake db and collection names used):

SELECT * FROM "mydb"."User" limit 10;

Here is an example error message:

NOT_SUPPORTED: Table has no columns: mongo_db:LambdaTableHandle{tableName=TableName{schemaName=mydb, tableName=user}}
This query ran against the "xxx" database, unless qualified by the query.

My first guess, based on the above error, is that Athena is lowercasing the collection name, and in so doing, not finding the correct collection.

Does anyone know:

  • If this is the case - i.e. that table names are lowercased?
  • If there are settings to change this - i.e. not to lowercase the table name?
  • If there is anything I can try

I'd appreciate any help or guidance!

Thanks!

질문됨 2년 전251회 조회
1개 답변
0

It was a known BUG in documentDB connector, it can be resolved by setting the following value in your ENV variables. set disable_projection_and_casing to true

Find the reported bug which now has been resolved. https://github.com/awslabs/aws-athena-query-federation/issues/463

AWS
답변함 9달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인