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

Add Gremlin "Except" and "Retain" filtering methods #74

Closed
pbnjay opened this issue Jul 21, 2014 · 5 comments
Closed

Add Gremlin "Except" and "Retain" filtering methods #74

pbnjay opened this issue Jul 21, 2014 · 5 comments

Comments

@pbnjay
Copy link
Contributor

pbnjay commented Jul 21, 2014

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.

@barakmich
Copy link
Member

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.

@pbnjay
Copy link
Contributor Author

pbnjay commented Jul 21, 2014

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...

@barakmich
Copy link
Member

Or at least that they have a reasonable Hash function, ie, changing graph.TSVal from an interface{} to, well, an actual interface.

@kortschak
Copy link
Contributor

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).

Or at least that they have a reasonable Hash function, ie, changing graph.TSVal from an interface{} to, well, an actual interface.

@robertmeta
Copy link
Contributor

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

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

No branches or pull requests

4 participants