dbt-trino icon indicating copy to clipboard operation
dbt-trino copied to clipboard

Trino can't read table when there is no files on S3

Open henrique0bl opened this issue 2 years ago • 1 comments

Hi we have a scenario where the data is written on S3 and Glue metastore. There is a tricky situation where sometimes the tables are created with no data, ie the query returns 0 rows and therefore the table is created but there is no data. When we try to query this table later we get the error:

SQL Error [16777220]: Query failed (#20220711_175341_09350_zawua): Partition location does not exist: s3://bucket/table...

Is there a way of pointing out to trino that the table is empty? I have no issues querying this table using Athena. Thank you

henrique0bl avatar Jul 11 '22 18:07 henrique0bl

Can you please describe in detail a reproduction scenario for this issue? Feel free to fill in some scripts for very small models that make this problem reproducible. Specifying the connector, how the schema is created (with or without location), whether the table is managed or external would also help.

findinpath avatar Jul 12 '22 03:07 findinpath