awslabs / aws-athena-query-federation

The Amazon Athena Query Federation SDK allows you to customize Amazon Athena with your own data sources and code.
Apache License 2.0
562 stars 297 forks source link

[BUG] Unsupported Presto type error when using Glue table for metadata with connector DocDB #2378

Open aidanasal opened 2 weeks ago

aidanasal commented 2 weeks ago

Describe the bug DocumentDB connector can't handle querying Document fields that nested. I defined a Glue Table for metadata and am trying to query a field in my DocumentDB collection that is several layers nested. I get the following error when trying to reference that field.

NOT_SUPPORTED: Unsupported Presto Type [row( array(row( varchar, varchar)), row( varchar, array(row( varchar, bigint, varchar, varchar)), double))] in Lambda Data Source

I think its having an issue when translating the types from the glue table schema and ending up with row type within a row.

This schema works when derived using Schema inference but not when using Glue table metadata.

To Reproduce Steps to reproduce the behavior:

  1. Deploy Athena DocumentDB Connector
  2. Put data in DocumentDB Collection that is multiple layers deep.
  3. Define explicit schema in Glue for connector to use.
  4. Execute athena query that references field with nested levels like a where field is not null clause.
  5. See error

Expected behavior Data to be returned and no error

Screenshots / Exceptions / Errors If applicable, add screenshots, exception stack traces, or error messages to help explain your problem. Stack traces for exceptions thrown by your Connector can be found in CloudWatch Logs under the 'aws/lambda/' log group.

Connector Details (please complete the following information):

Additional context