1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| #禁用表 disable '表名' #删表 drop '表名' #查看表是否存在 exsits '表名'
#增加列族 alter '表名','列族名' #删除列族 alter '表名',{NAME=>'列族名',METHOD=>'delete'} #更改列族储存版本的限制 alter '表明',{NAME=>'列族名',VERSIONS=>3}
#插入数据 put '表名','行键','列族','值' put 'student','2021900342','info:age','20' put 'student','2021900342','info:sex','male' put 'student','2021900342','info:name','yejunchen' put 'student','2021900300','info:age','20' put 'student','2021900300','info:height','170'
put 'yejunchen_result','1','info:xibu','9.1' put yejunchen_result','1','info:xibu','9.1' #查表 scan '表名' scan 'yejunchen_result','1' get '表名','行键' get '表名','行键','列族' get 'student','2021900342','info:name' #条件查询 scan '表名',FILTER=>"ValueFilter"(=,"xx:value") scan 'student',FILTER=>"ValueFilter(=,'binary:20')" scan 'student',FILTER=>"ValueFilter(=,'substring:ye')"
scan 'student',{COLUMNS=>"info:age",FILTER=>"ValueFilter(=,'binary:20')"} #删除 delete '表名','行键','列族' delete 'student','2021900300','info:height'
|