从hive导入到nebula时,使用NebulaGraph Exchange,如何设置rank

描述:比如这个储存边的表,包含两个顶点:分别为src_vid,和 dst_vid,这两个顶点有关联就会生成边储存在这个表里面,其中这两个顶点的个数去重分别为3979417,和3535248,但是还有一个属性字段是订单号,所以一共产生了1987万条边,如果没有属性订单号的话,那么去重之后就只有510万条边
我的文件是:
edge:
{
spark: {
app: {
name: ${APP_NAME}
}
}

nebula: {
address:{
graph:[${NEBULA_GRAPH_ADDRESS_GRAPH}]
meta:[${NEBULA_GRAPH_ADDRESS_META}]
}
user: ${NEBULA_GRAPH_USER}
pswd: ${NEBULA_GRAPH_PSWD}
space: ${NEBULA_GRAPH_SPACE_NAME}
connection: {
timeout: 6000
retry: 3
}
execution: {
retry: 3
}
error: {
max: 1024
output: /data/tmp/nebula/log/errors/
}
rate: {
limit: 2048
timeout: 3000
}
}

tags: [

]

edges: [

{
  name: ${NEBULA_GRAPH_LABEL_NAME}
  type: {
    source: ${DATA_SOURCE_TYPE}
    sink: ${DATA_SINK_TYPE}
  }
  exec:"${EXEC_SENTENCE}"
  fields: [${FIELDS}]
  nebula.fields: [${NEBULA_GRAPH_FIELDS}]
  source: {
    field: ${NEBULA_GRAPH_EDGES_SOURCE_VERTEX_FIELD}
  }
  target: {
    field: ${NEBULA_GRAPH_EDGES_TARGET_VERTEX_FIELD}
  }
  batch: 128
  partition: 16
  # nebula source start
  graph:[${NEBULA_GRAPH_SOURCE_ADDRESS_GRAPH}]
  meta:[${NEBULA_GRAPH_SOURCE_ADDRESS_META}]
  space: ${NEBULA_GRAPH_SOURCE_SPACE_NAME}
  user: ${NEBULA_GRAPH_SOURCE_USER}
  pswd: ${NEBULA_GRAPH_SOURCE_PSWD}
  timeout: 6000
  retry: 3
  # nebula source end
}

]

}

tag配置文件
{
spark: {
app: {
name: ${APP_NAME}
}
}

nebula: {
address:{
graph:[${NEBULA_GRAPH_ADDRESS_GRAPH}]
meta:[${NEBULA_GRAPH_ADDRESS_META}]
}
user: ${NEBULA_GRAPH_USER}
pswd: ${NEBULA_GRAPH_PSWD}
space: ${NEBULA_GRAPH_SPACE_NAME}
connection: {
timeout: 6000
retry: 3
}
execution: {
retry: 3
}
error: {
max: 1024
output: /data/tmp/nebula/log/errors/
}
rate: {
limit: 2048
timeout: 3000
}
}

tags: [

{
  name: ${NEBULA_GRAPH_LABEL_NAME}
  type: {
    source: ${DATA_SOURCE_TYPE}
    sink: ${DATA_SINK_TYPE}
  }
  exec:"${EXEC_SENTENCE}"
  fields: [${FIELDS}]
  nebula.fields: [${NEBULA_GRAPH_FIELDS}]
  vertex: {
    field: ${NEBULA_GRAPH_VERTEX_FIELD}
  }

  batch: 128
  partition: 16
  # nebula source start
  graph:[${NEBULA_GRAPH_SOURCE_ADDRESS_GRAPH}]
  meta:[${NEBULA_GRAPH_SOURCE_ADDRESS_META}]
  space: ${NEBULA_GRAPH_SOURCE_SPACE_NAME}
  user: ${NEBULA_GRAPH_SOURCE_USER}
  pswd: ${NEBULA_GRAPH_SOURCE_PSWD}
  timeout: 6000
  retry: 3
  # nebula source end
}

]

edges: [

]

}

补充说明:EXEC_SENTENCE="select vid, mem_id,crttime,updtime,blockcode from nebula.graph_fengkong

看 edge 里的 rank 配置

edges: [

{ 
  name: ${NEBULA_GRAPH_LABEL_NAME}
  type: {
    source: ${DATA_SOURCE_TYPE}
    sink: ${DATA_SINK_TYPE}
  }
  exec:"${EXEC_SENTENCE}"
  fields: [${FIELDS}]
  nebula.fields: [${NEBULA_GRAPH_FIELDS}]
  source: {
    field: ${NEBULA_GRAPH_EDGES_SOURCE_VERTEX_FIELD}
  }
  target: {
    field: ${NEBULA_GRAPH_EDGES_TARGET_VERTEX_FIELD}
  }
  ranging: crttime
  batch: 32
  partition: 16
  # nebula source start
  graph:[${NEBULA_GRAPH_SOURCE_ADDRESS_GRAPH}]
  meta:[${NEBULA_GRAPH_SOURCE_ADDRESS_META}]
  space: ${NEBULA_GRAPH_SOURCE_SPACE_NAME}
  user: ${NEBULA_GRAPH_SOURCE_USER}
  pswd: ${NEBULA_GRAPH_SOURCE_PSWD}
  timeout: 300000
  retry: 10
  # nebula source end
}

我在里面加了一个ranking: crttime
这样就可以了吗?

crttime这个是什么

这个就是nebula中的列的字段名

就是这个里面的补充说明:EXEC_SENTENCE="select vid, mem_id,crttime,updtime,blockcode from nebula.graph_fengkong

加个中括号

这两个是哪一个ranking: [crttime]和ranking: crttime

ranking has type LIST rather than STRING

老师,这个导入的时候,设置了ranking的时候,是不是这个只支持的字符串是int类型的

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。