跳转至

HANA Writer

HANA Writer 插件实现了写入数据到 SAP HANA 目的表的功能。

示例

假定要写入的 HANA 表建表语句如下:

create table system.addax_tbl
(
col1 varchar(200) ,
col2 int(4),
col3 date,
col4 boolean,
col5 clob
);

这里使用一份从内存产生到 HANA 导入的数据。

{
  "job": {
    "setting": {
      "speed": {
        "channel": 1,
        "bytes": -1
      }
    },
    "content": {
      "reader": {
        "name": "streamreader",
        "parameter": {
          "column": [
            {
              "value": "Addax",
              "type": "string"
            },
            {
              "value": 19880808,
              "type": "long"
            },
            {
              "value": "1988-08-08 08:08:08",
              "type": "date"
            },
            {
              "value": true,
              "type": "bool"
            },
            {
              "value": "test",
              "type": "bytes"
            }
          ],
          "sliceRecordCount": 1000
        }
      },
      "writer": {
        "name": "hanawriter",
        "parameter": {
          "connection": [
            {
              "jdbcUrl": "jdbc:sap://wgzhao-pc:39017/system",
              "table": [
                "addax_tbl"
              ]
            }
          ],
          "username": "system",
          "password": "HXEHana1",
          "column": [
            "*"
          ]
        }
      }
    }
  }
}

将上述配置文件保存为 job/hana2stream.json

执行采集命令

执行以下命令进行数据采集

bin/addax.sh job/hana2stream.json

参数说明

该插件基于 RDBMS Writer 实现,因此可以参考 RDBMS Writer 的所有配置项。