GraphScope
GraphScope copied to clipboard
feat (interactive): Migrating Gremlin compilation into the `Calsite`-based IR layer
The GIE IR layer is re-factored based on Calsite, which has now been used to compile the Cypher language into multiple runtime. However, the compilation of Gremlin is still in the pre-IR route, making the dual-language support of GIE in an inconsistent state, and the Gremlin path can not benefit from the on-going developing features of IR, including new optimization rules.
It's now ready to initiate the migration.
The following operators have currently been supported for conversion from syntax to Graph Relational: graph:
- V()
- E()
- outE
- inE()
- bothE()
- out() (include path_expand)
- in()
- both()
- inV()
- outV()
- otherV()
- endV()
filter:
- hasLabel
- hasId
- hasNot
- has
supported gremlin predicates:
- eq
- neq
- gt
- gte
- lt
- lte
- and
- or
- within
- without
- containing
- notContaining
- startingWith
- notStartingWith
- endingWith
- notEndingWith
- not
- inside
- outside
Project:
- values
- valueMap
- elementMap
- select (exclude apply)
Todo List: Support for other Syntax to Graph Relational conversion:
- [x] order
- [x] limit
- [x] dedup
- [x] groupBy
- [x] union
- [x] match
- [x] expr
- [x] subtask
- [ ] subgraph
在原先gremlin链路新支持的功能:
- [ ] until and more path_opt in path_expand
- [ ] sample
- [ ] unfold
Support for Graph Relational to IR Core conversion:
-
[ ] support nested map : select('a', 'b').by(valueMap(..))
-
[x] index predicate Allowing
withinoperator in index predicate to support queries likeg.V().hasId(1,2,3) -
[x] MAP_VALUE_CONSTRUCTOR
Further expand the implementation ofvarMapoperator -
[x] POSIX_REGEX_CASE_SENSITIVE To support startingWith/endingWith/containing/regex
-
[x] SEARCH
SEARCHandSargin Calcite are used to represent a value within a continuous or discrete interval, which need to be further unified with the current ir core structure. For example:has('age', within(17, 20)) -> SEARCH(DEFAULT.age, Sarg[17, 20]) has('age', without(17, 20)) -> SEARCH(DEFAULT.age, Sarg[(-∞..17), (17..20), (20..+∞)]) has('age', inside(17, 20)) -> SEARCH(DEFAULT.age, Sarg[[18..19]]) has('age', outside(17, 20)) -> SEARCH(DEFAULT.age, Sarg[(-∞..18), (19..+∞)])