AthenaにてShow partitionsが失敗する
現象
AWS Athenaにて特定テーブルのパーティションが多い場合、Show Partitionsにて、
パーティションの一覧を取得しようとすると、internal error
で失敗することがあります。
SHOW PARTITIONS {database}.{table_name}
Your query has the following error(s):
[ErrorCode: INTERNAL_ERROR_QUERY_ENGINE] Amazon Athena an experienced an internal error while executing this query. Please contact AWS support for further assistance. You will not be charged for this query. We apologize for the inconvenience.
This query ran against the "xxx" database, unless qualified by the query. Please post the error message on our forum or contact customer support with Query Id: xxxxxxxx-50d3-4699-ae41-XXXXXXXXXXXX.
テーブルのパーティションの数が多い場合に発生することがあるようです。
このテーブルに対して、MSCK REPAIR TABLE
を実行しても同じくエラーとなります。
AWSサポートに問い合わせたところ、AWS側の不具合との回答でした。(2020/07/02時点)
回避策
回避策としては、GlueのDataCatalogと統合されている場合には、
Glue側でパーティションの一覧を取得することができます。
GetPartitions
https://docs.aws.amazon.com/glue/latest/webapi/API_GetPartitions.htmlGetPartition
https://docs.aws.amazon.com/glue/latest/webapi/API_GetPartition.htmlBatchGetPartition
https://docs.aws.amazon.com/glue/latest/webapi/API_BatchGetPartition.html
Glueと統合されているケースは、基本Glue側のAPIを使用して、パーティションの更新等を実施するのが良さそうですね。
Author And Source
この問題について(AthenaにてShow partitionsが失敗する), 我々は、より多くの情報をここで見つけました https://qiita.com/nbtd/items/19d4f65a7722edbd5ba5著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .