进入命令行:
./sqlline.py 172.16.0.5:2181
0: jdbc:phoenix:172.16.0.5:2181>
help 查看命令帮助
!tables 查看表
建表 create table test01(id integer primary key,name varchar);
UPSERT INTO test01 VALUES (1, ‘admin’);
select * from test01 limit 1; select count(*) from test01;
建索引 create index my_index on PHOENIXTEST(RECEIVERID); 建索引后,会新建一个my_index的表 该表中会有2个字段,其中:ID是自动创建的,其实就是HBase中的主键RowKey,0:RECEIVERID是我们刚刚手动创建的。
查看索引,通过查看表来查看 !table
索引相关可以参考 https://blog.csdn.net/bingoxubin/article/details/85023299
!describe friend_notify_msg 查看表结构
建表分区 https://blog.csdn.net/silentwolfyh/article/details/51613317
CREATE TABLE SALT_TEST (a_key VARCHAR PRIMARY KEY, a_col VARCHAR) SALT_BUCKETS = 20;
关于region: https://my.oschina.net/puwenchao/blog/1934772
![]() |
![]() |