Xiaoli Zhou

Results 7 comments of Xiaoli Zhou

目前compiler主要支持了gremlin语言,并引入antlr做相关的语法检查,整体链路大致为antlr语法检查->ast树 (traversal结构) -> ir表示层,主要功能是针对不同的用户层语言检查并翻译为ir的algebra表示,具体步骤为: - 在antlr语法层,我们定义了一系列[gremlin语法 ](https://github.com/alibaba/GraphScope/blob/main/interactive_engine/compiler/src/main/antlr4/GremlinGS.g4),并通过antlr翻译为相应的antlr语法树,compiler基于antlr的语法树结构作进一步[parse](https://github.com/alibaba/GraphScope/blob/main/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/antlr4/TraversalMethodVisitor.java),转化为gremlin相关的ast结构; - 在优化层,我们基于traversal结构apply一些[启发式优化](https://github.com/alibaba/GraphScope/tree/main/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/plugin/strategy),i.e. fuse V/E + filter && fuse outE+filter/inV/count ... - 在ast翻译层,我们进一步将ast结构[翻译](https://github.com/alibaba/GraphScope/blob/main/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/transform/StepTransformFactory.java)为ir的逻辑表示,这个部分主要是对gremlin功能接近的算子进行聚合,并对齐到ir提供的algebra接口上; gremlin在语言定义和表示方面存在一定缺陷,一方面gremlin提供的算子太过揉杂,算子和算子之前的功能边界并不清晰,在用户使用方面会觉得太过复杂;另一方面,gremlin的语言定义和执行并没有很好的解耦,自带的ast结构不仅仅包含算子表示,还包括了内部实现,当引入其他语言时 (i.e. cypher),这样的结构很难直接用来复用; 为了避免上述问题,在引入cypher时,我们会重新定义/refine中间的ast结构,目前考虑参考[gsql](https://www.tigergraph.com/gsql/)的相关表示,并将gremlin的相关算子统一到该结构上;更进一步的,我们会基于该结构apply相关的逻辑执行优化,目前考虑参考[calcite](https://github.com/apache/calcite)的parser层;

set max streaming buffer capacity in https://github.com/alibaba/GraphScope/pull/3630/commits/d1348513962451e8fe72175a8411f392c15af238

docs added in https://github.com/alibaba/GraphScope/pull/3637/commits/027fb76f2df052f7f4e0adb7aece1133212c6340

The following operators have currently been supported for conversion from syntax to Graph Relational: graph: - V() - E() - outE - inE() - bothE() - out() (include path_expand) -...

Todo List: Support for other Syntax to Graph Relational conversion: - [x] order - [x] limit - [x] dedup - [x] groupBy - [x] union - [x] match - [x]...

> > 这个where感觉有点像match的意思,而且和Cypher的where语句的功能是一致的,目前Cypher实现成 inner Join,语义上实际应该是semi-join。cypher和gremlin的这两个语法应该要统一实现 > > @shirly121 Please create a new issue for this before this pr can be merged. https://github.com/alibaba/GraphScope/issues/3766

感谢你对我们的宝贵意见,我这里回复下你提出的几点问题: * 返回点/边里没有属性 这个是因为我们默认采取了lazy mode来返回点/边数据,如果没有特别指定,返回的点边就会缺省properties,主要从减少数据量角度考虑; * 第二次返回和第一次返回重复 这个表现不太正常,我猜测有没有可能是client端对结果有cache导致的呢?我这边也尽快找环境看看能不能复现; * 返回column乱序 这个问题已经fix在 [3672](https://github.com/alibaba/GraphScope/pull/3672/files#diff-16e8b66f6994065b2efbd6e94e4e4aa42d2fe7f69cdd0fa9b581c5c185d0dd3a),graphscope最新版本是0.27.0,还没包含该fix,在下一个版本里会带上; * 如何获取点的所有属性 `n.properties`意思是获取n点中名为'properties'的属性,但点并没有'properties'属性所以会产生上述报错;如果要获取所有属性,官方用法是`properties(n)`,这个我们目前还未支持,我这边新建了issue [3773](https://github.com/alibaba/GraphScope/issues/3773) 会尽快补充该功能;