-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add Gremlin "Except" and "Retain" filtering methods #74
Comments
These sound pretty straightforward -- it'd be interesting to try to build the tree, however. A "Not" iterator seems reasonable here to make Except happen. It's a little like optional in that it shouldn't be nexted (or, if it is, it's expensive) and is defined as an (All minus (whatever subiterator)) The more we can delay evaluation, the better we could (potentially) optimize things. Worth keeping in mind at least -- it doesn't have to do that today. |
Yeah my initial thinking is that "aggregate" basically populates a FixedIterator, and then that can be used for the checks. I'd also want to create a special-case FixedIterator which uses a map[Value] to make sure Check()s are fast vs the current slice-backed implementation. Although that means Values might need a consistent hash representation... |
Or at least that they have a reasonable Hash function, ie, changing graph.TSVal from an interface{} to, well, an actual interface. |
An alternative to enforcing a Hash implementation is to conditionally type assert and use the Hash method if it exists or fall back to hashing the value otherwise. On the downside, this would be somewhat slower and is a little magical (would need to be documented).
|
Moved this over to feature requests as it seems to have been sitting here without much implementation for a long time, maybe over there it will generate some new excitement: https://discourse.cayley.io/t/add-gremlin-except-and-retain-filtering-methods/239 |
Along with requisite "Aggregate" method as described here:
https://github.com/tinkerpop/gremlin/wiki/Except-Retain-Pattern
This'll allow much better query support and output.
The text was updated successfully, but these errors were encountered: