diff --git a/src/common/base/Base.h b/src/common/base/Base.h index 0f85a45702b..501cfdc19f5 100644 --- a/src/common/base/Base.h +++ b/src/common/base/Base.h @@ -156,11 +156,11 @@ using VariantType = boost::variant; #endif // reserved property names -constexpr char _ID[] = "_id"; -constexpr char _SRC[] = "_src"; -constexpr char _TYPE[] = "_type"; -constexpr char _RANK[] = "_rank"; -constexpr char _DST[] = "_dst"; +constexpr char _ID[] = "_id"; +constexpr char _SRC[] = "_src"; +constexpr char _TYPE[] = "_type"; +constexpr char _RANK[] = "_rank"; +constexpr char _DST[] = "_dst"; // Useful type traits // Tell if `T' is copy-constructible diff --git a/src/common/filter/Expressions.cpp b/src/common/filter/Expressions.cpp index da6b6257d54..4eaa4dbf1e7 100644 --- a/src/common/filter/Expressions.cpp +++ b/src/common/filter/Expressions.cpp @@ -110,7 +110,7 @@ std::string AliasPropertyExpression::toString() const { std::string buf; buf.reserve(64); buf += *ref_; - if (*ref_ != "" && *ref_ != "$") { + if (*ref_ != "" && *ref_ != VAR_REF) { buf += "."; } buf += *alias_; diff --git a/src/graph/test/YieldTest.cpp b/src/graph/test/YieldTest.cpp index ba72403c644..850dcbd5849 100644 --- a/src/graph/test/YieldTest.cpp +++ b/src/graph/test/YieldTest.cpp @@ -412,6 +412,7 @@ TEST_F(YieldTest, yieldVar) { TEST_F(YieldTest, error) { { cpp2::ExecutionResponse resp; + // Reference input in a single yield sentence is meaningless. auto query = "yield $-"; auto code = client_->execute(query, resp); UNUSED(code); @@ -421,6 +422,7 @@ TEST_F(YieldTest, error) { { cpp2::ExecutionResponse resp; auto &player = players_["Boris Diaw"]; + // Not support reference input and variable auto fmt = var + "YIELD $var.team WHERE $-.start > 2005"; auto query = folly::stringPrintf(fmt.c_str(), player.vid()); auto code = client_->execute(query, resp); @@ -429,6 +431,7 @@ TEST_F(YieldTest, error) { { cpp2::ExecutionResponse resp; auto &player = players_["Boris Diaw"]; + // Not support reference two diffrent variable auto fmt = var + "YIELD $var.team WHERE $var1.start > 2005"; auto query = folly::stringPrintf(fmt.c_str(), player.vid()); auto code = client_->execute(query, resp); @@ -437,6 +440,7 @@ TEST_F(YieldTest, error) { { cpp2::ExecutionResponse resp; auto &player = players_["Boris Diaw"]; + // Reference properties in single yield sentence is meaningless. auto fmt = var + "YIELD $$.a.team"; auto query = folly::stringPrintf(fmt.c_str(), player.vid()); auto code = client_->execute(query, resp);