- nebula 版本:Version 1.0.1
- 部署方式( 单机 ):
- 硬件信息
- 磁盘(HDD):
- CPU、内存信息:
- 出问题的 Space 的创建方式:
go from 100 over edge_mobile,edge_bank_card_no yield edge_mobile._src as tag_o1 ,edge_mobile._dst as tag_p1 , edge_bank_card_no ._src as tag_c1 |go from $-.tag_p1,$-.tag_c1 over edge_mobile REVERSELY where edge_mobile._dst!=$-.tag_o1 yield $-.tag_o1 as tag_o1,edge_mobile._src as tag_p1,edge_mobile._dst as tag_o2 - 问题的具体描述
go from 在使用管道的时候,想引用前面的vid 只能是一个变量么?例如上图语句中的 go from $-.tag_p1 ,而不能 go from $-.tag_p1,$-.tag_c1 这种形式。
可以通过 $-.*
来表示所有的输入:
go from 100 over edge_mobile,edge_bank_card_no \
yield edge_mobile._src as tag_o1 ,edge_mobile._dst as tag_p1 , edge_bank_card_no ._src as tag_c1 | \
go from $-.* over edge_mobile REVERSELY \
yield $-.tag_o1 as tag_o1,edge_mobile._src as tag_p1,edge_mobile._dst as tag_o2
你上面语句中的 WHERE
过滤 nebula 1.0 不支持的,会在 nebula 2.0 中支持的。
目前不支持多个变量属性输入
我的理解 既然 go from vid1,vid2,vid3 这种 ,理论上个对于 [vid1,vid2],[vid4,vid5]这样的 应该很容易就实现了吧。另外 $-.*的语义是是么?是前面yield 输出的所有内容么?可能我需要过滤部分结果,并不需要所有,yeild输出 的原因是有些显示的数据需要传递到最后一个。但是查询查询的数据可能只需要其中的一部分
是的,如果想基于前面 yield 的部分列,还有一种方案是通过变量,然后做 union,类似:
$var = go from 100 over edge_mobile,edge_bank_card_no yield edge_mobile._src as tag_o1 ,edge_mobile._dst as tag_p1 , edge_bank_card_no ._src as tag_c1;
go from $var.tag_p1 over edge_mobile REVERSELY \
yield $var.tag_o1 as tag_o1,edge_mobile._src as tag_p1,edge_mobile._dst as tag_o2 \
UNION \
go from $var.tag_c1 over edge_mobile REVERSELY \
yield $var.tag_o1 as tag_o1,edge_mobile._src as tag_p1,edge_mobile._dst as tag_o2;
1 个赞
可以先说明一下实际场景需求,因为首先要确保你的语句是正确对应到场景且没有歧义的。
比如语句里边有几个点我不确定是否是你的本意:
-
edge_bank_card_no ._src as tag_c1
是 100 吗 -
edge_mobile._dst!=$-.tag_o1
的语义是否是edge_mobild._dst not in collect($-.tag_o1)
- 类似
go from $-.col1,$-.col2 yield $-.col3
这样的语法实际上是有歧义的