Skip to content

Instantly share code, notes, and snippets.

@clarksun
Created December 23, 2017 01:55
Show Gist options
  • Save clarksun/c9a1509c8a259690ee7ee03fbcdfd86e to your computer and use it in GitHub Desktop.
Save clarksun/c9a1509c8a259690ee7ee03fbcdfd86e to your computer and use it in GitHub Desktop.
happybase create delete table
# frontera HBaseQueue class
# tablename一定要to_bytes一下
from w3lib.util import to_bytes
table_name = to_bytes(table_name)
tables = set(connection.tables())
if drop and table_name in tables:
connection.delete_table(table_name, disable=True)
tables.remove(table_name)
if table_name not in tables:
connection.create_table(table_name, {'f': {'max_versions': 1, 'block_cache_enabled': 1}})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment