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 ?

posta 2 anni fa949 visualizzazioni
1 Risposta
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
ESPERTO
Matt-B
con risposta 2 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande