Star

Nebula使用中间变量进行查询报错

提问参考模版:

  • nebula 版本:v1.2.0
  • 问题的具体描述
  • 我使用多个中间变量$var1, $var2, $var3,然后用一个中间变量$var4记录它们的并集,在使用$var4进行查询报错
$var1 = go from hash('6C5UTc6T44E=') over human_enterprise_holder where human_enterprise_holder.history == 0 yield human_enterprise_holder._dst as e_holder_id; $var2 = go from hash('6C5UTc6T44E=') over human_enterprise_legal_represent where human_enterprise_legal_represent.history == 0 yield human_enterprise_legal_represent._dst as e_legal_id; $var3 = go from hash('6C5UTc6T44E=') over human_enterprise_member where human_enterprise_member.history == 0 and human_enterprise_member.isExecutive == 1 yield human_enterprise_member._dst as e_member_id; $var4 = yield $var1.* union yield $var2.* union yield $var3.*; yield $var4.*
  • 查询结果-查看$var4
    image
  • 通过$var4进行最终查询
$var1 = go from hash('6C5UTc6T44E=') over human_enterprise_holder where human_enterprise_holder.history == 0 yield human_enterprise_holder._dst as e_holder_id; $var2 = go from hash('6C5UTc6T44E=') over human_enterprise_legal_represent where human_enterprise_legal_represent.history == 0 yield human_enterprise_legal_represent._dst as e_legal_id; $var3 = go from hash('6C5UTc6T44E=') over human_enterprise_member where human_enterprise_member.history == 0 and human_enterprise_member.isExecutive == 1 yield human_enterprise_member._dst as e_member_id; $var4 = yield $var1.* union yield $var2.* union yield $var3.*; go from $var4.$var1.e_holder_id over human_enterprise_holder,human_enterprise_legal_represent,human_enterprise_member reversely

可以仿照这个写法:

$var1=go from hash("V1") over E1 yield E1._dst as dst; 
$var2=go from hash("V2") over E2 yield E2._dst as dst;
$var3=yield $var1.dst as dst union yield $var2.dst;
go from $var3.dst over E3 reversely 
1赞

浙ICP备20010487号