apache phoenix 入门_HBase-Phoenix入门

安装好Phoenix后配置环境变量

export PHOENIX_PATH=/opt/cloudera/parcels/APACHE_PHOENIX-4.14.0-cdh5.14.2.p0.3

export PATH=$PATH:$PHOENIX_PATH/bin:

进入命令行,这是sqlline.py 配置到path环境变量的情况下

[root@node1 ~]# phoenix-sqlline.py node3:2181:/hbase

如果要退出命令行:!q 或者 !quit

返回信息

[root@node1 ~]# phoenix-sqlline.py node3:2181:/hbase

Setting property: [incremental,false]

Setting property: [isolation, TRANSACTION_READ_COMMITTED]

issuing:!connect jdbc:phoenix:node3:2181:/hbase none none org.apache.phoenix.jdbc.PhoenixDriver

Connecting to jdbc:phoenix:node3:2181:/hbase

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found bindingin [jar:file:/opt/cloudera/parcels/APACHE_PHOENIX-4.14.0-cdh5.14.2.p0.3/lib/phoenix/phoenix-4.14.0-cdh5.14.2-client.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found bindingin [jar:file:/opt/cloudera/parcels/CDH-5.14.2-1.cdh5.14.2.p0.3/jars/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]19/06/20 20:03:49 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

Connected to: Phoenix (version4.14)

Driver: PhoenixEmbeddedDriver (version4.14)

Autocommit status:trueTransaction isolation: TRANSACTION_READ_COMMITTED

Building list of tables and columnsfor tab-completion (set fastconnect to trueto skip)...865/865 (100%) Done

Done

sqlline version1.2.0

显示所有表

0: jdbc:phoenix:node3:2181:/hbase> !tables

返回信息

0: jdbc:phoenix:node3:2181:/hbase> !tables+------------+--------------+-------------------------+---------------+----------+------------+-------+

| TABLE_CAT | TABLE_SCHEM | TABLE_NAME | TABLE_TYPE | REMARKS | TYPE_NAME | SELF_ |

+------------+--------------+-------------------------+---------------+----------+------------+-------+

| | | INDEX1_ITEM_TEST1 | INDEX | | | |

| | SYSTEM | CATALOG | SYSTEM TABLE | | | |

| | SYSTEM | FUNCTION | SYSTEM TABLE | | | |

| | SYSTEM | LOG | SYSTEM TABLE | | | |

| | SYSTEM | SEQUENCE | SYSTEM TABLE | | | |

| | SYSTEM | STATS | SYSTEM TABLE | | | |

| | | ASSET_ALLOT | TABLE | | | |

| | | ASSET_BUILDING | TABLE | | | |

| | | ASSET_BUILDING_PENDING | TABLE | | | |

| | | ASSET_CHECK | TABLE | | | |

| | | ASSET_CHECK_PLAN | TABLE | | | |

| | | ASSET_CHECK_REPORT | TABLE | | | |

| | | ASSET_FINANCIAL_DETAIL | TABLE | | | |

| | | ASSET_INVENTORY | TABLE | | | |

| | | ASSET_INVENTORY_PLAN | TABLE | | | |

| | | ASSET_INVENTORY_REPORT | TABLE | | | |

| | | ASSET_ISLAND | TABLE | | | |

| | | ASSET_ISLAND_PENDING | TABLE | | | |

| | | ASSET_NORMAL | TABLE | | | |

| | | ASSET_NORMAL_MOULD | TABLE | | | |

| | | ASSET_NORMAL_PENDING | TABLE | | | |

| | | ASSET_RECORD | TABLE | | | |

| | | ASSET_RENT | TABLE | | | |

| | | ASSET_ROOM | TABLE | | | |

| | | ASSET_SCRAP | TABLE | | | |

| | | ASSET_SEAL | TABLE | | | |

| | | ASSET_TAKEAWAY | TABLE | | | |

| | | ASSET_UNSEAL | TABLE | | | |

| | | ITEM_TEST1 | TABLE | | | |

| | | US_POPULATION | TABLE | | | |

| | | US_POPULATION1 | TABLE | | | |

+------------+--------------+-------------------------+---------------+----------+------------+-------+

从表 ASSET_RECORD 中查询前10条记录

0: jdbc:phoenix:node3:2181:/hbase> SELECT * FROM ASSET_RECORD LIMIT 10;

返回信息

0: jdbc:phoenix:node3:2181:/hbase> SELECT * FROM ASSET_RECORD LIMIT 10;+-----------------------------------+-------------------------+-------------------+---------------+---+

| ID | ASSET_ID | MANAGEMENT_TABLE | INTRODUCTION | |

+-----------------------------------+-------------------------+-------------------+---------------+---+

| d083250dc0f74c3cb79b6ffe041fa4c3 | 仪6-1133208949747748815 | ASSET_CHECK | | 8 |

+-----------------------------------+-------------------------+-------------------+---------------+---+

1 row selected (0.066 seconds)

参考:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值