Exchange 导入 Hive 数据:bigint 字段 无法转换成 timestamp

环境信息:

  • nebula 版本:v1.2.0
  • 部署方式:docker-compose
  • nebula exchange:v1.1.0

问题的具体描述:导入 Hive 表数据,bigint 类型的字段无法映射到 nebula graph 里 timestamp 类型的字段。

Hive 表:

CREATE TABLE `job_demo`(
  `task_id` string,
  `start_time` bigint)
PARTITIONED BY (
  `dt` string)
ROW FORMAT DELIMITED
  FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
  'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
  'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
  'hdfs://.....'
TBLPROPERTIES (
  'transient_lastDdlTime'='1612084522')

Hive 数据预览

Nebula Graph

nebula exchange config 中字段的映射关系

# Processing tags
  tags: [

    # Loading from Hive
    {
      name: job
      type: {
        source: hive
        sink: client
      }
      exec: "select task_id, start_time from job_demo where dt='20210121'"
      fields: [task_id, start_time]
      nebula.fields: [job_oid, start_time]
      vertex: {
        field: task_id
        policy: "hash"
      }
      batch: 1024
      partition: 32
      isImplicit: true
    }
  ]

查询不到插入的记录:以上述 hive 数据预览截图的第一条数据为例

BTW:如果将 TAG job 的 start_time 字段从 timestamp 改成 int 类型,数据导入时成功的

这里还要麻烦 @darionyaphet 帮忙看一下!是否是 timestamp 类型的数据的映射有问题?

据我所知 目前 long 和 timestamp 类型正在写 不就就会支持

你看下exchange导入时的日志信息,没插入成功会有error日志的。 1.0是支持long型的timestamp插入的,暂不支持“2021-01-01T00:00:00”格式的。

使用 exchange 2.0 可以导入