用Python操作HBase之happybase

2021-08-14 15:28:12 字數 2300 閱讀 4569

安裝thrift的具體操作,鏈結

port:埠

timeout:超時時間

autoconnect:連線是否直接開啟

table_prefix:用於構造表名的字首

table_prefix_separator:用於table_prefix的分隔符

compat:相容模式

transport:運輸模式

protocol:協議

connection.open()
connection.close()

connection.compact_table(name,major=false)

families = 

connection.create_table(name,families) # 如果連線時,有傳遞表字首引數時,真實表名將會是:"{}_{}".format(table_prefix,name)

connection.delete_table(name,disable=false)

connection.disable_table(name)

connection.enable_table(name)

connection.is_table_enabled(name)
user_prefix:是否使用表字首,預設為true

table_name_list =connection.tables()
connection:連線

content = table.cells('row1','cf:1',5,timestamp=1514861929124,include_timestamp=true)

print content # [('1', 1514861925674l)]

table.counter_set(row,column,value=0)

content =table.counter_get(row,column)

content =table.counter_dec(row,column,value=1)

content =table.counter_inc(row,column,value=1)

table.delete(row, columns=none, timestamp=none, wal=true)
info = table.families()

print info

, 'cd':

}

# 在row1行,cf:1列插入值1

table.put("row1",)

info = table.regions()

print info

#

info = table.row(row, columns=none, timestamp=none, include_timestamp=false)

info = table.

rows(rows, columns=

none, timestamp=

none, include_timestamp=

false)

scanner = table.scan(row_start=none, row_stop=none, row_prefix=none, columns=none, filter=none, timestamp=none, include_timestamp=false, batch_size=1000, scan_batching=none, limit=none, sorted_columns=false, reverse=false)
if url_scheme == '':

修改為:

iflen(url_scheme) <= 1:

python操作 hbase 資料

python使用的包 thrift 個人使用的python 編譯器是pycharm community edition.在工程中設定中,找到project interpreter,在相應的工程下,找到package,然後選擇 新增,搜尋 hbase thrift python client for ...

大資料HBase系列之HBase基本操作

hbase version hbase zkcli hbase shell 2.1 建立表 語法 create 表名 列族名 create student info 2.2 顯示所有表 語法 list 或 list 表名 list student 2.3 顯示表描述 語法 describe 表名 d...

HBase常用操作之namespace

參考 1 介紹 在hbase中,namespace命名空間指對一組表的邏輯分組,類似rdbms中的database,方便對錶在業務上劃分。apache hbase從0.98.0,0.95.2兩個版本開始支援namespace級別的授權操作,hbase全域性管理員可以建立 修改和 namespace的...