Star

使用Exchange从neo4j导入nebula边时,报错 java.lang.Long is not a valid external type for schema of double

在nebula创建的边的结构
image
在neo4j中边的weight属性范围是0.0~1.0,用double类型写入的


但是导入过程中报错:Error while encoding: java.lang.RuntimeException: java.lang.Long is not a valid external type for schema of double
整个边结构,只有weight是double类型,上面从neo4j查询,weight也没有long类型的数据

@nicole 美女大佬来帮忙啦~

我怀疑是数据问题,但又找不到证据 :flushed:

找到导致出问题的数据了,这条数据weight 是1 不是1.0

sorry~~ 我在看对应报错的代码。
这个weight 如果数据类型是double的话,应该不会转Long类型的。

你有设置边的rank么

发一下配置文件中edge的配置吧,是不是给rank 设置了weight

应该是从neo4j读出来的数据spark认为是long类型了,然后转成nebula的double报错了,我这边没设置rank。

 # Loading tag from neo4j
    {
      name: usertomobile
      type: {
        source: neo4j
        sink: client
      }
      server: "bolt://xxxx:7687"
      user: xxx
      password: xxx
          exec: "match (a:user)-[r:usertomobile]->(b:mobile) where  id(r) <= 300000000 return a.vid, b.vid, r.weight as weight, r.relaFirstDay as relaFirstDay, r.relaLastDay as relaLastDay, r.scene as scene, r.realHisDay as realHisDay order by id(r)"
      fields: [weight, relaFirstDay, relaLastDay, scene, realHisDay]
      nebula.fields: [weight, relaFirstDay, relaLastDay, scene, realHisDay]
      source: {
        field: a.vid
        policy: "uuid"
      }
      target: {
        field: b.vid
        policy: "uuid"
      }
      partition: 10
      batch: 1000
      check_point_path: /tmp/test
    }

跳过我上面发的那条数据之后,导入就没问题了。

1赞

浙ICP备20010487号