Go 查询中 where 子句 id(vertex) 过滤结果有误

  • nebula 版本:v2.6.2
  • 部署方式:分布式
  • 安装方式:RPM

如上图所示,我们真实想查的其实是二度关联点(需剔除自身),但是发现 where 中 id($$) 过滤似乎不起作用,想问下是是 bug ,还是设计如此?有没有替代的实现?

为了方便研发同学来修改查询语句,可以终端语句用文本的形式粘贴下吗

语句:

go 1 to 1 steps from "p3" over * bidirect where properties(edge).start_time >= 2000 and properties(edge).start_time <= 3000 yield distinct dst(edge) as midVid | go 1 to 1 steps from $-.midVid over live, work, take_device, apply, emergency, relative, take_cellphone reversely where id($$) == "p3"
go 1 to 1 steps from "p3" over * bidirect where properties(edge).start_time >= 2000 and properties(edge).start_time <= 3000 yield distinct dst(edge) as midVid | go 1 to 1 steps from $-.midVid over live, work, take_device, apply, emergency, relative, take_cellphone reversely where id($$) == "p2"
go 1 to 1 steps from "p3" over * bidirect where properties(edge).start_time >= 2000 and properties(edge).start_time <= 3000 yield distinct dst(edge) as midVid | go 1 to 1 steps from $-.midVid over live, work, take_device, apply, emergency, relative, take_cellphone reversely

你可以输出一下

go 1 to 1 steps from "p3" over * bidirect where properties(edge).start_time >= 2000 and properties(edge).start_time <= 3000 yield distinct dst(edge) as midVid | go 1 to 1 steps from $-.midVid over live, work, take_device, apply, emergency, relative, take_cellphone reversely yield $^ as src, $$ as dst, edge as e

看看什么结果

是版本问题, where语句里面支持。$$ 和$^ 是在3.0 的版本上才添加的, 你可以更新一下版本

如果版本不支持,为啥不报语法错误呢?

emm… 我能说忘记添加报错信息了吗

1 个赞

就是我看 文档里面其实有说,where 不支持,但是我看 properties(edge) 好像没问题,id(vertex) 有问题,就是用起来挺困惑的

不是 properties(edge) 没问题, 其实是正好 你 yield 语句里 写了 edge 然后where 语句中的 edge 生效了。 其实 where 子句是都不支持 $$ $^ 和edge 的

那我可以理解为 yield 中声明了,那么会触发 where 中生效?我试了下好像可以,这样会不会有性能问题吗?感觉不是很正规的用法……

不会有性能问题, 本来计划的 只是在yield 中支持, 后来发现 where 中也需要用

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