vesoft-inc / nebula

A distributed, fast open-source graph database featuring horizontal scalability and high availability
https://nebula-graph.io
Apache License 2.0
10.68k stars 1.2k forks source link

support properties expression in WHERE clause for LOOKUP #4848

Open wey-gu opened 1 year ago

wey-gu commented 1 year ago

Introduction


(root@nebula) [basketballplayer]> LOOKUP ON player WHERE properties(vertex).name == "Tony Parker" YIELD properties(vertex).name as name
[ERROR (-1009)]: SemanticError: Expression (properties(VERTEX).name=="Tony Parker") not supported yet

By intuition, this is reasonable and we could infer that it's equivalent to player.mane == "Tony Parker", also, it's supported in GO to do WHERE properties($$) == "foo".

Plus, those who are building ORM/templating dev job will benefit from this, too.

Contents

https://discuss.nebula-graph.com.cn/t/topic/11126/12

Related work

BOFA1ex commented 1 year ago

The same as FETCH, WHERE properties(vertex) == 'foo' or WHERE player.name == 'foo' expressions are both supported.

It's necessary to make it(syntax) align.

struct LookupContext final : public AstContext {
  bool isEdge{false};
  bool dedup{false};
  bool isEmptyResultSet{false};
  int32_t schemaId{-1};
  Expression* filter{nullptr}; // using ExpressionProps repleace it?
  YieldColumns* yieldExpr{nullptr};
  std::vector<std::string> idxReturnCols;
  std::vector<std::string> idxColNames;
  // order by
};
wey-gu commented 1 year ago

BTW @BOFA1ex , are you planning open-sourcing your downstream OGM ;)

BOFA1ex commented 1 year ago

Exactly, the OGM framework is bound to our internal-biz product. So i cannot give an answer, it's beyond my ability to decide whether open source is planned.

But i'm glad to make it nebula-contrib better together :)

wey-gu commented 1 year ago

Thanks~~ And whenever you are considering splitting the OGM part and open-sourcing, let us know!

BOFA1ex commented 1 year ago

It will consider compatible with 2.6.x~3.x? : upstream cc @wey-gu

BOFA1ex commented 1 year ago

It seems that it has become inactive, any planning as feature on next milestone?