Created
September 21, 2018 11:15
-
-
Save khellan/335465ca5d72ace94e1c80387ee6a459 to your computer and use it in GitHub Desktop.
Batchwise deletion of malformed HBase row keys. It will not stop when done so it needs monitoring.
This file contains 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
import happybase | |
connection = happybase.Connection(HBASE_MASTER_IP) | |
table = connection.table(TABLE_NAME) | |
while True: | |
batch = table.batch() | |
for key, _ in table.scan(columns=[COLUMN_NAMES], filter="RowFilter(=, 'regexstring:.*\x09.*')", limit=10000): | |
batch.delete(key) | |
batch.send() | |
print(key) | |
connection.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment