s3 inventory Atena query

0

I have s3 inventory service setup done. I have imported data into Athena as CSV format. Is there a way that I can query number of objects in a particularly directory in Athena ?

質問済み 2年前950ビュー
1回答
1

Yes

You can run something like

select count(key) from <your_table>
where key like 'your_prefix%'

Lets say you have 3 objects

  • prefix1/prefix2/object1.txt
  • prefix1/prefix2/object2.txt
  • prefix1/prefix3/object3.txt
select count(key) from <your_table>
where key like 'prefix1/prefix2/%'

This would return 2

Check out this blog post for more examples

https://aws.amazon.com/blogs/storage/manage-and-analyze-your-data-at-scale-using-amazon-s3-inventory-and-amazon-athena/

profile pictureAWS
エキスパート
Matt-B
回答済み 2年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ