2017-11-16 19 views
0

Hbaseテーブルの同じ行キーに対して同じ列ファミリの複数の列に値を挿入できるHbase putコマンドを探しています。 私は、1列のファミリの 'データ'を持つ 'employee'というhbaseテーブルを持っているとします。Hbaseの同じファミリの複数の列に値を入力

私は以下のコマンドを適用していますがエラーになります。

PUT 'employee' 'data:column1', 'column1_val', 'data:column2', 'column_val2' 
ERROR: no method 'add' for arguments (org.jruby.java.proxies.ArrayJavaProxy,org.jruby.RubyNil,org.jruby.RubyString,org.jruby.java.proxies.ArrayJavaProxy) on Java::OrgApacheHadoopHbaseClient::Put available overloads: 

ただし、各列の値の挿入ごとに別々のputコマンドを試しても問題ありません。

PUT 'employee' 'data:column1', 'column1_val' 
PUT 'employee' 'data:column2', 'column2_val' 

単一のputコマンドで同じ列ファミリに属する​​複数の列に値を挿入する方法はありますか?

答えて

0

HBaseのシェルが1つのステートメントで複数の列をサポートしていません

hbase(main):002:0> help "put" 
Put a cell 'value' at specified table/row/column and optionally 
timestamp coordinates. To put a cell value into table 'ns1:t1' or 't1' 
at row 'r1' under column 'c1' marked with the time 'ts1', do: 

    hbase> put 'ns1:t1', 'r1', 'c1', 'value' 
    hbase> put 't1', 'r1', 'c1', 'value' 
    hbase> put 't1', 'r1', 'c1', 'value', ts1 
    hbase> put 't1', 'r1', 'c1', 'value', {ATTRIBUTES=>{'mykey'=>'myvalue'}} 
    hbase> put 't1', 'r1', 'c1', 'value', ts1, {ATTRIBUTES=>{'mykey'=>'myvalue'}} 
    hbase> put 't1', 'r1', 'c1', 'value', ts1, {VISIBILITY=>'PRIVATE|SECRET'} 

The same commands also can be run on a table reference. Suppose you had a reference 
t to table 't1', the corresponding command would be: 

    hbase> t.put 'r1', 'c1', 'value', ts1, {ATTRIBUTES=>{'mykey'=>'myvalue'}} 

あなたがが同じタイムスタンプを持つ複数のプットを作成することができ、それは結構です。

関連する問題