使用go n steps做聚合操作时,返回的结果不正确

创建TAG

create tag user(product_no string, user_id string)

创建EDGE

create edge pay(product_no string, user_id string, pay_amt double, pay_cnt int)

导入数据

  • user
"hash(""a001_1"")","a001",1
"hash(""a001_2"")","a001",2
"hash(""a001_3"")","a001",3
"hash(""a001_4"")","a001",4
"hash(""a001_5"")","a001",5
"hash(""a001_6"")","a001",6
"hash(""a001_7"")","a001",7
"hash(""a001_8"")","a001",8
"hash(""a001_9"")","a001",9
  • pay
"hash(""a001_1"")","hash(""a001_2"")",a001,2,1000.0,2
"hash(""a001_1"")","hash(""a001_3"")",a001,3,1000.0,2
"hash(""a001_1"")","hash(""a001_4"")",a001,4,1000.0,2
"hash(""a001_1"")","hash(""a001_5"")",a001,5,1000.0,2
"hash(""a001_1"")","hash(""a001_6"")",a001,6,1000.0,2
"hash(""a001_6"")","hash(""a001_7"")",a001,7,500.0,3
"hash(""a001_6"")","hash(""a001_8"")",a001,8,500.0,3
"hash(""a001_6"")","hash(""a001_9"")",a001,9,500.0,3
"hash(""a001_2"")","hash(""a001_7"")",a001,20,300.0,1
"hash(""a001_2"")","hash(""a001_8"")",a001,21,300.0,1
"hash(""a001_2"")","hash(""a001_9"")",a001,22,300.0,1
"hash(""a001_7"")","hash(""a001_10"")",a001,10,200.0,1
"hash(""a001_7"")","hash(""a001_11"")",a001,11,200.0,1
"hash(""a001_7"")","hash(""a001_12"")",a001,12,200.0,1

查询SQL

LOOKUP ON user WHERE user.product_no == 'a001' yield user.user_id as user_id |go 2 steps from $-.VertexID over pay yield $-.user_id as user_id,pay.pay_amt as amt,pay.pay_cnt as cnt|group by $-.user_id yield $-.user_id as id,sum($-.amt) as amt_1,sum($-.cnt) as cnt_1 | order by amt_1 DESC | limit 10

查询结果

为什么存在两种结果???

稳定复现么

是的

方便吧importer的配置和csv文件发一份么

直接用console返回的什么结果

使用console执行两次的结果:

csv文件内容

在提问中的 “导入数据” 部分已经贴出

importer

version: v1rc1
description: example
clientSettings:
  concurrency: 2
  channelBufferSize: 1
  space: pay_info
  connection:
    user: test
    password: test
    address: IP:3699,IP:3699
logPath: ./err/test.log
files:
  - path: /usr/local/nebula/files/edge_pay_tmp.csv
    failDataPath: ./err/edge_pay_tmp.csv
    batchSize: 128
    type: csv
    csv:
      withHeader: false
      withLabel: false
      delimiter: ","
    schema:
      type: edge
      edge:
        name: pay
        withRanking: false
        props:
          - name: product_no
            type: string
          - name: user_id
            type: string
          - name: pay_amt
            type: double
          - name: pay_cnt
            type: int
  - path: /usr/local/nebula/files/node_user_tmp.csv
    failDataPath: ./err/node_user_tmp.csv
    batchSize: 128
    type: csv
    csv:
      withHeader: false
      withLabel: false
      delimiter: ","
    schema:
      type: vertex
      vertex:
        tags:
          - name: user
            props:
              - name: product_no
                type: string
              - name: user_id
                type: string

麻烦问一下,这个问题有结论了不 ?

有些问题,我们后续会跟踪修复

好的,修复了麻烦通知一下哈~

1 个赞

已经修复了,可以使用nightly的包验证

1 个赞

好的,多谢啦,我拿案例试下~