With the HappyBase API for HBase in Python, a batch insert can be performed by the following:
import happybase
connection = happybase.Connection()
table = connection.table('table-name')
batch = table.batch()
# put several rows to this batch via batch.put()
batch.send()
What would happen in the event this batch failed half way through? Would the rows that had been saved remain saved and those that didn't not be saved?
I noted in the HappyBase github that the table.batch()
method takes transaction
and wal
as parameters. Could these be configured in such a way as to rollback the successfully saved rows in the event the batch fails halfway through?
Will happybase throw an exception here, which would permit me to take note of the row keys and perform a batch delete?