Created
July 29, 2019 15:42
-
-
Save vepetkov/b0757f1f04a85060122fcce7d50e5f6d to your computer and use it in GitHub Desktop.
Delete S3 Hive Partitions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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