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

How to use the source vertex ID to generate a random seed and control the result of GO...LIMIT[list]? #3201

Closed
randomJoe211 opened this issue Oct 25, 2021 · 1 comment

Comments

@randomJoe211
Copy link
Contributor

Nebula Graph version: 2021.10.21-nightly

I want to do a random sampling in GO based on the source vertex ID. How to construct the nGQL statement?

Is this right:

GO 3 STEPS FROM "player100" OVER * YIELD LIMIT [abs(rand32(hash(src(edge))%5)), abs(rand32(hash(src(edge))%5)), abs(rand32(hash(src(edge))%5))]

If yes:
LIMIT [abs(rand32(hash(src(edge))%5)), --Is the src here the first vertex?
abs(rand32(hash(src(edge))%5)), -- Which vertex does the src in this line represents?
abs(rand32(hash(src(edge))%5))] -- Which vertex does the src in this line represents?

@nevermore3
Copy link
Contributor

nevermore3 commented Oct 25, 2021

same problem #3202

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

3 participants