Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SemanticError: Vid should be a FIXED_STRING #196

Closed
hjing100 opened this issue Feb 10, 2022 · 2 comments
Closed

SemanticError: Vid should be a FIXED_STRING #196

hjing100 opened this issue Feb 10, 2022 · 2 comments

Comments

@hjing100
Copy link

hjing100 commented Feb 10, 2022

执行:
GO FROM hash("姚明[中国篮球协会主席、中职联公司董事长]") OVER relation YIELD relation.name AS Name, $$.entity.name AS Value;

显示:

[ERROR (-1009)]: SemanticError: Vid should be a FIXED_STRING

@wey-gu
Copy link
Contributor

wey-gu commented Feb 10, 2022

不知道您导入数据是怎么配置 VID 的?这个 hash() 实际上是 nebula graph v1 时代因为 VID 只支持 int64,不支持 string 类型的时候常用的,到了 nebula 2.0,可以把 "姚明[中国篮球协会主席、中职联公司董事长]" 整体作为 id,具体要看你导入怎么做的。
是 1. 直接 "姚明[中国篮球协会主席、中职联公司董事长]"
还是 2. 先 hash 在变成 string?

这里您的 GO 语句里的hash("姚明[中国篮球协会主席、中职联公司董事长]")是一个 int64,报这个错误因为您的 space 创建的时候指定了 String(fixed length)。

@hjing100
Copy link
Author

我的VID不是hash计算得到的,是index得到的,类型也有问题,应该是string
运行成功:
GO FROM "44514" OVER relation YIELD relation.name AS Name, $$.entity.name AS Value;

谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants