Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch put and delete semantics inconsistent #224

Open
jnwatson opened this issue Jun 24, 2019 · 0 comments
Open

Batch put and delete semantics inconsistent #224

jnwatson opened this issue Jun 24, 2019 · 0 comments

Comments

@jnwatson
Copy link

Happybase version 1.2.0.

A batch.delete, then a batch.put on the same key in the same batch results in the key not being present. Outside of a batch, this has the expected semantics.

Does anybody have any idea why?

Example:

import happybase

connection = happybase.Connection('hbase-docker', 9090)
try:
    connection.create_table('t2', {'s': dict()})
except Exception:
    pass
table = connection.table('t2')
key = b'key1'
val = b'abcd'

# A put/delete outside of a batch
table.delete(key)
table.put(key, {b's:d': val})
actual = table.row(key)
if actual[b's:d'] != val:
    print('Invalid value outside of batch')

# Same inside of a batch
b = table.batch()
b.delete(key)
b.put(key, {b's:d': val})
b.send()

actual = table.row(key)
if b's:d' not in actual:
    print('Value missing')
elif actual.get(b's:d') != val:
    print('Invalid value for batch')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant