Skip to content

iotdb target 可把 Spark Dataset 持久化到 iotdb 中。table_name 为 SparkSQL Flow 中 source 或 Transform 的表;iotdb 没有表的概念,需要在结果转换中,转为 root.db.innernal.serial.metric 的形式:

sql
select dataTime as Time, cast(pValue as float) pValue from source_file

比如上一步执行的中间结果,可采用如下的入库配置:

xml
<!-- iotdb -->
<target type="iotdb"
        table_name="result_t"
        iotdb_uri="jdbc:iotdb://192.168.1.100:6667/"
        username="root"
        password="root"
        columns_mapping="Time,pValue:root.ln.hyd.gate1004.open_height">
</target>

说明

  • Time 第一列一般为时间戳;
  • 后续的列需要转换为 root.db.innernal.serial.metric 的形式;
  • 支持一次性插入多个列;