keyloadtool_phoenix 利用CsvBulkLoadTool 批量带入数据并自动创建索引
需要先創(chuàng)建表:
CREATE TABLE IF NOT EXISTS population (
state CHAR(2) NOT NULL, city VARCHAR NOT NULL, population BIGINT
CONSTRAINT my_pk PRIMARY KEY (state, city));
在phoenix 目錄下執(zhí)行
hadoop jar /home/phoenix-4.6.0-HBase-1.0-bin/phoenix-4.6.0-HBase-1.0-client.jar ? org.apache.phoenix.mapreduce.CsvBulkLoadTool -t POPULATION -i /datas/us_population.csv
-t :tableName
-i: input file 文件必須在hdfs文件上。
后查詢表數(shù)據(jù)是空。
問題:?ERROR mapreduce.CsvBulkLoadTool: Error Wrong FS: file:/home/hadoop/tmp/partitions_101bd67a-ec2c-4808-bc9f-bf4cd6ea74b9, expected: hdfs://node11:9000 occurred submitting CSVBulkLoad
參數(shù)意義:
-a,--array-delimiter Array element delimiter (optional)
-c,--import-columns Comma-separated list of columns to be
imported
-d,--delimiter Input delimiter, defaults to comma
-e,--escape Supply a custom escape character, default is
a backslash
-g,--ignore-errors Ignore input errors
-h,--help Show this help and quit
-i,--input Input CSV path (mandatory)
-it,--index-table Phoenix index table name when just loading
this particualar index table
-o,--output Output path for temporary HFiles (optional)
-q,--quote Supply a custom phrase delimiter, defaults
to double quote character
-s,--schema Phoenix schema name (optional)
-t,--table Phoenix table name (mandatory)
-z,--zookeeper Supply zookeeper connection details
(optional)
原文:http://www.cnblogs.com/zhanggl/p/5191912.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎總結(jié)
以上是生活随笔為你收集整理的keyloadtool_phoenix 利用CsvBulkLoadTool 批量带入数据并自动创建索引的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 在c语言程序中 对文件进行操作首先要,《
- 下一篇: ps导出gif颜色不对_PS基础知识(1