nebula 1.2 里面 go语句多边属性过滤结果的疑问

提问参考模版:

  • nebula 版本:1.2
  • 部署方式(分布式 / 单机 / Docker / DBaaS):分布式
  • 硬件信息
    • 磁盘( 推荐使用 SSD)SSD
    • CPU、内存信息 32G
  • 问题的具体描述
    测试的数据来自官方的nba数据,对如下不符合预期的语句 有点疑惑 是bug吗?还是实现的时候就不支持这样的条件过滤?


返回0行 不符合预期(预期返回3行)
go from 100 over follow ,serve where   (serve.start_year < 1999 ) || (follow.degree > 94)  YIELD follow._src,follow.degree,follow._dst,serve._src,serve.start_year,serve.end_year,serve._dst 
返回0行 不符合预期(预期返回3行)
go from 100 over follow ,serve where  serve.start_year < 1999  or  follow.degree == 95  YIELD follow._src,follow.degree,follow._dst,serve._src,serve.start_year,serve.end_year,serve._dst 
返回0行 不符合预期(预期返回3行)
go from 100 over follow ,serve  where follow.degree == 95 or serve.start_year == 1997   YIELD follow._src,follow.degree,follow._dst,serve._src,serve.start_year,serve.end_year,serve._dst,$$.player.name,$$.player.age,$$.team.name 


返回2行 符合预期
GO FROM 100 OVER * WHERE  $$.player.age == 41 or serve.start_year > 1996  yield $$.player.age,$$.player.name,serve.start_year,serve.end_year ;
返回3行 符合预期
GO FROM 100 OVER * WHERE  $$.player.age >= 11 or serve.start_year > 1996  yield $$.player.age,$$.player.name,serve.start_year,serve.end_year ;
返回3行 符合预期
GO FROM 100 OVER * WHERE  $$.player.age >= 33   or  serve.start_year > 1996  yield $$.player.age,$$.player.name,serve.start_year,serve.end_year ;
返回3行 符合预期
go from 100 over follow ,serve  YIELD follow._src,follow.degree,follow._dst,serve._src,serve.start_year,serve.end_year,serve._dst,$$.player.name,$$.player.age,$$.team.name 
返回2行 符合预期
go from 100 over follow ,serve where $$.player.age > 37 or $$.team.name =='Spurs'  YIELD follow._src,follow.degree,follow._dst,serve._src,serve.start_year,serve.end_year,serve._dst,$$.player.name,$$.player.age,$$.team.name 
返回3行 符合预期
go from 100 over follow ,serve where $$.player.age > 17 or $$.team.name =='Spurs'  YIELD follow._src,follow.degree,follow._dst,serve._src,serve.start_year,serve.end_year,serve._dst,$$.player.name,$$.player.age,$$.team.name 
返回3行 符合预期
go from 100 over follow ,serve  where follow.degree == 95 or ( $$.player.age >= 36 or $$.team.name =='Spurs' ) YIELD follow._src,follow.degree,follow._dst,serve._src,serve.start_year,serve.end_year,serve._dst,$$.player.name,$$.player.age,$$.team.name 


go from 100 over follow ,serve  where follow.degree == 95 or serve.start_year == 1997   YIELD follow._src,follow.degree,follow._dst,serve._src,serve.start_year,serve.end_year,serve._dst,$$.player.name,$$.player.age,$$.team.name 

替代方案?(如果边 和 tag较多 这种方式估计不行)
go from 100 over follow ,serve YIELD follow.degree as degree ,follow._dst as f_dst,serve.start_year as start_year,serve.end_year as end_year,serve._dst as s_dst  | yield $-.degree,$-.f_dst,$-.start_year,$-.end_year,$-.s_dst where  ($-.start_year == 1997 ) || ($-.degree == 95)


我本地用了 1.0 的 nba 数据集,发现没有 follow 这条边类型 :joy: 你能否提供一下你如何拿的官方的 nba 数据?

@yee

https://docs.nebula-graph.com.cn/manual-CN/1.overview/2.quick-start/1.get-started/

看了你提的几个不符合预期的语句,都是对两种类型的边同时过滤,这里面对表达式求值需要 @jmq2020 来具体定位一下

试了一下nebula 2 nightly

结果 符合预期
go from "player100" over follow ,serve where   (serve.start_year < 1999 ) or (follow.degree > 94)  YIELD follow._src,follow.degree,follow._dst,serve._src,serve.start_year,serve.end_year,serve._dst 
go from "player100" over follow ,serve where  serve.start_year < 1999  or  follow.degree == 95  YIELD follow._src,follow.degree,follow._dst,serve._src,serve.start_year,serve.end_year,serve._dst 
go from "player100" over follow ,serve  where follow.degree == 95 or serve.start_year == 1997   YIELD follow._src,follow.degree,follow._dst,serve._src,serve.start_year,serve.end_year,serve._dst,$$.player.name,$$.player.age,$$.team.name 
1赞

你看一下,1.0你用的是啥时候的版本,你可以试试最新的版本,我在最新的版本上没有问题

官网下的1.2正式版

/nebula --version
nebula version 1.2.0, Git: 53f56b69, Build Time: Dec 8 2020 11:20:57
This source code is licensed under Apache 2.0 License, attached with Common Clause Condition 1.0.

@jmq2020

更新一下最新的代码吧, 在最新的版本上这个问题已经解决了

什么时候 发布一个nebula 1.x 的bugfix版本安装包啊

正在准备发布分支,测试过了就会 release

cc @jude-zhu

1赞

@jude-zhu PM小姐姐来回答

预计下周哈~

1赞

浙ICP备20010487号