Skip to content

Compatibility fix for Athena Glue#1343

Merged
electrum merged 1 commit intotrinodb:masterfrom
hgschmie:athena-glue-compat-fix
Sep 11, 2019
Merged

Compatibility fix for Athena Glue#1343
electrum merged 1 commit intotrinodb:masterfrom
hgschmie:athena-glue-compat-fix

Conversation

@hgschmie
Copy link
Member

Athena is fine reading Glue tables that have no table type set. The same table will cause Presto to NPE as the
table type can not be null in presto. This fix will use MANAGED_TABLE if the table type is not set.

@cla-bot cla-bot bot added the cla-signed label Aug 20, 2019
@findepi
Copy link
Member

findepi commented Aug 21, 2019

Please change commit message to something like

Fix handling of Glue tables with table type unset

@hgschmie hgschmie force-pushed the athena-glue-compat-fix branch 2 times, most recently from 890d94f to fab4df9 Compare August 21, 2019 17:15
@martint martint requested a review from electrum August 27, 2019 23:17
Copy link
Member

@electrum electrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than using EXTERNAL rather than MANAGED, this looks good.

Glue tables without a table type set are read by AWS Athena and treated as external tables.

The same metadata causes Presto to NPE when accessing the table as Presto requires the table type to be set.

This change lets Presto treat tables without table type as external tables as well.
@hgschmie hgschmie force-pushed the athena-glue-compat-fix branch from fab4df9 to b850db7 Compare September 10, 2019 20:36
@hgschmie
Copy link
Member Author

changed it to "EXTERNAL_TABLE"

@electrum electrum merged commit 79057cf into trinodb:master Sep 11, 2019
@electrum
Copy link
Member

Merged, thanks!

@electrum electrum mentioned this pull request Sep 20, 2019
6 tasks
@martint martint added this to the 319 milestone Sep 21, 2019
v-jizhang added a commit to v-jizhang/presto that referenced this pull request Apr 23, 2021
Cherry pick of Trino trinodb/trino#1343,
Athena is fine reading Glue tables that have no table type set.
Currently Presto set to default OTHER but Athena tables are external:
https://docs.aws.amazon.com/athena/latest/ug/drop-table.html so set
the table type to EXTTERNAL if it is unset.

Co-authored-by: Henning Schmiedehausen <henning@schmiedehausen.org>
highker pushed a commit to prestodb/presto that referenced this pull request May 20, 2021
Cherry pick of Trino trinodb/trino#1343,
Athena is fine reading Glue tables that have no table type set.
Currently Presto set to default OTHER but Athena tables are external:
https://docs.aws.amazon.com/athena/latest/ug/drop-table.html so set
the table type to EXTTERNAL if it is unset.

Co-authored-by: Henning Schmiedehausen <henning@schmiedehausen.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants