walter的drill笔试之二-安装与部署
? ? ? {
? ? ? ? "type":"parquet",
? ? ? ? "dfsName" : “hdfs://{hadoop的namenode地址}:9000”
? ? ? },
? ? "json" :
? ? ? {
? ? ? ? "type":"json",
? ? ? ? "dfsName" : "hdfs://{hadoop的namenode地址}:9000"
? ? ? }
2.2测试
2.2.1测试drill集群是否启动成功
zkCli.sh -server {zookeeper地址}:2181
get /drill/drillbits1
cZxid = 0x100000003
ctime = Tue Dec 10 10:18:42 CST 2013
mZxid = 0x100000003
mtime = Tue Dec 10 10:18:42 CST 2013
pZxid = 0x10000001c
cversion = 12
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 0
numChildren = 4
这次测试用了numChildren = 4个节点
2.2.2测试QUERY
把数据放到HDFS上 ? hadoop fs -put sample-data /
链接集群 sqlline -u jdbc:drill:schema=parquet
SELECT _MAP['R_REGIONKEY'] as region_key, _MAP['R_NAME'] AS name, _MAP['R_COMMENT'] AS comment FROM “/sample-data/region.parquet";
SELECT count(distinct _MAP['N_REGIONKEY']) FROM “/sample-data/nation.parquet";? ?
SELECT _MAP['N_REGIONKEY'] as regionKey, _MAP['N_NAME'] as name FROM “/sample-data/nation.parquet" WHERE cast(_MAP['N_NAME'] as varchar) < 'M';
?
2.3 关闭集群
2.3.1关闭drill集群
在每个节点上执行 sudo drillbit.sh stop?
2.3.2关闭zookeeper
在每个节点上执行 sudo zkServer.sh stop
2.3.3在namenode上执行
sudo stop-all.sh