zoukankan      html  css  js  c++  java
  • phoenix 利用CsvBulkLoadTool 批量带入数据并自动创建索引

    需要先创建表:

    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 目录下执行

    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文件上。

    后查询表数据是空。

    问题: ERROR mapreduce.CsvBulkLoadTool: Error Wrong FS: file:/home/hadoop/tmp/partitions_101bd67a-ec2c-4808-bc9f-bf4cd6ea74b9, expected: hdfs://node11:9000 occurred submitting CSVBulkLoad 

     参数意义:

    -a,--array-delimiter <arg> Array element delimiter (optional)
    -c,--import-columns <arg> Comma-separated list of columns to be
    imported
    -d,--delimiter <arg> Input delimiter, defaults to comma
    -e,--escape <arg> Supply a custom escape character, default is
    a backslash
    -g,--ignore-errors Ignore input errors
    -h,--help Show this help and quit
    -i,--input <arg> Input CSV path (mandatory)
    -it,--index-table <arg> Phoenix index table name when just loading
    this particualar index table
    -o,--output <arg> Output path for temporary HFiles (optional)
    -q,--quote <arg> Supply a custom phrase delimiter, defaults
    to double quote character
    -s,--schema <arg> Phoenix schema name (optional)
    -t,--table <arg> Phoenix table name (mandatory)
    -z,--zookeeper <arg> Supply zookeeper connection details
    (optional)

  • 相关阅读:
    Linux 使用Mycat实现读写分离(基于Mysql的读写分离)
    CentOS7安装GitLab、汉化、邮箱配置及使用
    ESXI6.7更换系统默认SSL证书和密钥
    nexus备份恢复
    负载均衡基本原理与lvs
    GitHub项目管理基本操作
    git 拉取远程分支到本地
    如何在Github中删除已有仓库或文件
    GitHub教程(二) 删除已有仓库
    下载 github 项目文件到本地方法
  • 原文地址:https://www.cnblogs.com/zhanggl/p/5191912.html
Copyright © 2011-2022 走看看