1 Respuesta
- Más nuevo
- Más votos
- Más comentarios
0
Hi,
Athena automatically creates metadata files when it moves files using the start_query_execution command. In order to delete the .csv.metadata files, you can use the following logic below. Make sure to use item.key to get the name of the object. The try statement will skip over the s3.ObjectSummary object that is giving this error.
session = boto3.session.Session()
s3 = session.resource('s3')
my_bucket = s3.Bucket(<bucketname>)
for item in my_bucket.objects.filter(Prefix=<subbucketpath>):
try:
if item.key.endswith('.csv.metadata'):
item.delete()
except Exception as e:
print("The following error occured: {}".format(e))
Reference: https://docs.aws.amazon.com/athena/latest/ug/querying.html
respondido hace 9 meses
Contenido relevante
- OFICIAL DE AWSActualizada hace un año
- OFICIAL DE AWSActualizada hace 2 años
- OFICIAL DE AWSActualizada hace un año
- OFICIAL DE AWSActualizada hace 8 meses