Created
December 23, 2017 01:55
-
-
Save clarksun/c9a1509c8a259690ee7ee03fbcdfd86e to your computer and use it in GitHub Desktop.
happybase create delete table
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
# 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