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년 전949회 조회
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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠