Skip to content

Instantly share code, notes, and snippets.

@vepetkov
Created July 29, 2019 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vepetkov/b0757f1f04a85060122fcce7d50e5f6d to your computer and use it in GitHub Desktop.
Save vepetkov/b0757f1f04a85060122fcce7d50e5f6d to your computer and use it in GitHub Desktop.
Delete S3 Hive Partitions
# Get the Hive Symlinks
aws s3 ls s3://<BUCKET>/hive/ --recursive | awk '{print "s3://<BUCKET>/"$4}'
# Delete all data files for the selected Hive partition
aws s3 cp s3://<BUCKET>/hive/dt=2019-07-24-00-00/symlink.txt - | xargs -I {} sh -c 'aws s3 rm {}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment