chunjun的安装与使用

  • 官网地址

https://github.com/DTStack/chunjun

下载解压即可使用

  • hbase2hive案例
    配置文件
{
  "job": {
    "content": [
      {
        "reader": {
          "table" : {
            "tableName": "students"
          },
          "name": "hbasereader",
          "parameter": {
            "table":"students",
            "hbaseConfig": {
              "hbase.zookeeper.property.clientPort": "2181",
              "hbase.rootdir": "hdfs://master:9000/hbase",
              "hbase.cluster.distributed": "true",
              "hbase.zookeeper.quorum": "master,node1,node2",
              "zookeeper.znode.parent": "/hbase"
            },
            "encoding": "utf-8",
            "column": [
              {
                "name": "rowkey",
                "type": "string"
              },
              {
                "name": "info:name",
                "type": "string"
              }
            ],
            "startRowkey": "",
            "endRowkey": "",
            "isBinaryRowkey": true
          }
        },
        "writer": {
          "name" : "hivewriter",
          "parameter" : {
            "jdbcUrl" : "jdbc:hive2://master:10000/default",
            "username" : "root",
            "password" : "",
            "fileType" : "text",
            "fieldDelimiter" : ",",
            "writeMode" : "overwrite",
            "charsetName" : "UTF-8",
            "maxFileSize" : 1073741824,
            "schema" : "default",
            "tablesColumn" : "{\"stu\":[{\"comment\":\"\",\"type\":\"varchar\",\"key\":\"id\"},{\"comment\":\"\",\"type\":\"varchar\",\"key\":\"name\"}]}",
            "defaultFS" : "hdfs://master:9000"
          }
        }
      }
    ],
    "setting": {
      "speed": {
        "channel": 1
      }
    }
  }
}

以本地模式执行

hive查询结果

成功!!

posted @ 2024-11-28 20:46  w我自横刀向天笑  阅读(4)  评论(0编辑  收藏  举报