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

fix(interactive): Support elementMap() for a path entry in GOpt #3992

Merged
merged 12 commits into from
Jul 9, 2024

Conversation

BingqingLyu
Copy link
Collaborator

What do these changes do?

As titled. Now we support elementMap() for a path entry in GOpt, an example is as below:

gremlin> g.V().hasLabel("person").both("1..3","knows").with('RESULT_OPT', 'ALL_V').elementMap("name","age")
==>[{age=27, name=vadas, ~id=2, ~label=0}, {age=29, name=marko, ~id=1, ~label=0}]
==>[{age=32, name=josh, ~id=4, ~label=0}, {age=29, name=marko, ~id=1, ~label=0}]
==>[{age=29, name=marko, ~id=1, ~label=0}, {age=27, name=vadas, ~id=2, ~label=0}]
==>[{age=29, name=marko, ~id=1, ~label=0}, {age=32, name=josh, ~id=4, ~label=0}]
==>[{age=27, name=vadas, ~id=2, ~label=0}, {age=29, name=marko, ~id=1, ~label=0}, {age=27, name=vadas, ~id=2, ~label=0}]
==>[{age=27, name=vadas, ~id=2, ~label=0}, {age=29, name=marko, ~id=1, ~label=0}, {age=32, name=josh, ~id=4, ~label=0}]
==>[{age=32, name=josh, ~id=4, ~label=0}, {age=29, name=marko, ~id=1, ~label=0}, {age=27, name=vadas, ~id=2, ~label=0}]
==>[{age=32, name=josh, ~id=4, ~label=0}, {age=29, name=marko, ~id=1, ~label=0}, {age=32, name=josh, ~id=4, ~label=0}]
==>[{age=29, name=marko, ~id=1, ~label=0}, {age=27, name=vadas, ~id=2, ~label=0}, {age=29, name=marko, ~id=1, ~label=0}]
==>[{age=29, name=marko, ~id=1, ~label=0}, {age=32, name=josh, ~id=4, ~label=0}, {age=29, name=marko, ~id=1, ~label=0}]

Related issue number

Fixes #3988

@BingqingLyu
Copy link
Collaborator Author

A related issue should be addressed #3991. Currently, a temporally solution is to ignore the exception and further parse the result value.

@BingqingLyu BingqingLyu changed the title feat(interactive): Support elementMap() for a path entry in GOpt fix(interactive): Support elementMap() for a path entry in GOpt Jul 1, 2024
It is important to note that the specific elements targeted for property projection are determined by the `RESULT_OPT` setting.
For instance, if you configure `RESULT_OPT` as `ALL_V`, `values()` or `valueMap()` will then project the properties of all vertices present in the path.
For instance, if you configure `RESULT_OPT` as `ALL_V`, `values()`, `valueMap()`, or `elementMap()` will then project the properties of all vertices present in the path.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add doc for explaining when certain attributes does not exist.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

longbinlai
longbinlai previously approved these changes Jul 5, 2024
@siyuan0322 siyuan0322 merged commit 1037512 into alibaba:main Jul 9, 2024
58 checks passed
@BingqingLyu BingqingLyu deleted the fix_elementmap branch July 15, 2024 03:45
BingqingLyu added a commit to shirly121/GraphScope that referenced this pull request Jul 24, 2024
…aba#3992)

As titled. Now we support elementMap() for a path entry in GOpt, an
example is as below:
```
gremlin> g.V().hasLabel("person").both("1..3","knows").with('RESULT_OPT', 'ALL_V').elementMap("name","age")
==>[{age=27, name=vadas, ~id=2, ~label=0}, {age=29, name=marko, ~id=1, ~label=0}]
==>[{age=32, name=josh, ~id=4, ~label=0}, {age=29, name=marko, ~id=1, ~label=0}]
==>[{age=29, name=marko, ~id=1, ~label=0}, {age=27, name=vadas, ~id=2, ~label=0}]
==>[{age=29, name=marko, ~id=1, ~label=0}, {age=32, name=josh, ~id=4, ~label=0}]
==>[{age=27, name=vadas, ~id=2, ~label=0}, {age=29, name=marko, ~id=1, ~label=0}, {age=27, name=vadas, ~id=2, ~label=0}]
==>[{age=27, name=vadas, ~id=2, ~label=0}, {age=29, name=marko, ~id=1, ~label=0}, {age=32, name=josh, ~id=4, ~label=0}]
==>[{age=32, name=josh, ~id=4, ~label=0}, {age=29, name=marko, ~id=1, ~label=0}, {age=27, name=vadas, ~id=2, ~label=0}]
==>[{age=32, name=josh, ~id=4, ~label=0}, {age=29, name=marko, ~id=1, ~label=0}, {age=32, name=josh, ~id=4, ~label=0}]
==>[{age=29, name=marko, ~id=1, ~label=0}, {age=27, name=vadas, ~id=2, ~label=0}, {age=29, name=marko, ~id=1, ~label=0}]
==>[{age=29, name=marko, ~id=1, ~label=0}, {age=32, name=josh, ~id=4, ~label=0}, {age=29, name=marko, ~id=1, ~label=0}]
```

Fixes alibaba#3988

---------

Co-authored-by: Longbin Lai <[email protected]>
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

Successfully merging this pull request may close these issues.

[BUG] Unexpected results when project elementMap() of a path
3 participants