diff --git a/src/graph/validator/FetchEdgesValidator.cpp b/src/graph/validator/FetchEdgesValidator.cpp index 0dc826c9650..3ad7ad6119c 100644 --- a/src/graph/validator/FetchEdgesValidator.cpp +++ b/src/graph/validator/FetchEdgesValidator.cpp @@ -150,34 +150,14 @@ void FetchEdgesValidator::extractEdgeProp(ExpressionProps &exprProps) { } Status FetchEdgesValidator::validateYield(const YieldClause *yield) { - auto pool = qctx_->objPool(); - bool noYield = false; if (yield == nullptr) { - // TODO: compatible with previous version, this will be deprecated in version 3.0. - auto *yieldColumns = new YieldColumns(); - auto *edge = new YieldColumn(EdgeExpression::make(pool), "edges_"); - yieldColumns->addColumn(edge); - yield = pool->add(new YieldClause(yieldColumns)); - noYield = true; + return Status::SemanticError("Missing yield clause."); } fetchCtx_->distinct = yield->isDistinct(); - auto &exprProps = fetchCtx_->exprProps; - auto *newCols = pool->add(new YieldColumns()); - if (!noYield) { - auto *src = new YieldColumn(EdgeSrcIdExpression::make(pool, edgeName_)); - auto *dst = new YieldColumn(EdgeDstIdExpression::make(pool, edgeName_)); - auto *rank = new YieldColumn(EdgeRankExpression::make(pool, edgeName_)); - outputs_.emplace_back(src->name(), vidType_); - outputs_.emplace_back(dst->name(), vidType_); - outputs_.emplace_back(rank->name(), Value::Type::INT); - newCols->addColumn(src); - newCols->addColumn(dst); - newCols->addColumn(rank); - exprProps.insertEdgeProp(edgeType_, kSrc); - exprProps.insertEdgeProp(edgeType_, kDst); - exprProps.insertEdgeProp(edgeType_, kRank); - } + exprProps.insertEdgeProp(edgeType_, nebula::kSrc); + exprProps.insertEdgeProp(edgeType_, nebula::kDst); + exprProps.insertEdgeProp(edgeType_, nebula::kRank); for (const auto &col : yield->columns()) { if (ExpressionUtils::hasAny(col->expr(), {Expression::Kind::kEdge})) { @@ -186,8 +166,10 @@ Status FetchEdgesValidator::validateYield(const YieldClause *yield) { } } auto size = yield->columns().size(); - outputs_.reserve(size + 3); + outputs_.reserve(size); + auto pool = qctx_->objPool(); + auto *newCols = pool->add(new YieldColumns()); for (auto col : yield->columns()) { if (ExpressionUtils::hasAny(col->expr(), {Expression::Kind::kVertex, Expression::Kind::kPathBuild})) { diff --git a/src/graph/validator/FetchVerticesValidator.cpp b/src/graph/validator/FetchVerticesValidator.cpp index 3dbcd19eaa5..100a51c1df8 100644 --- a/src/graph/validator/FetchVerticesValidator.cpp +++ b/src/graph/validator/FetchVerticesValidator.cpp @@ -13,8 +13,6 @@ namespace nebula { namespace graph { -static constexpr char VertexID[] = "VertexID"; - Status FetchVerticesValidator::validateImpl() { auto *fSentence = static_cast(sentence_); fetchCtx_ = getContext(); @@ -52,26 +50,15 @@ Status FetchVerticesValidator::validateTag(const NameLabelList *nameLabels) { } Status FetchVerticesValidator::validateYield(YieldClause *yield) { - auto pool = qctx_->objPool(); - bool noYield = false; if (yield == nullptr) { - // TODO: compatible with previous version, this will be deprecated in version 3.0. - auto *yieldColumns = new YieldColumns(); - auto *vertex = new YieldColumn(VertexExpression::make(pool), "vertices_"); - yieldColumns->addColumn(vertex); - yield = pool->add(new YieldClause(yieldColumns)); - noYield = true; + return Status::SemanticError("Missing yield clause."); } fetchCtx_->distinct = yield->isDistinct(); auto size = yield->columns().size(); - outputs_.reserve(size + 1); + outputs_.reserve(size); + auto pool = qctx_->objPool(); auto *newCols = pool->add(new YieldColumns()); - if (!noYield) { - outputs_.emplace_back(VertexID, vidType_); - auto *vidCol = new YieldColumn(InputPropertyExpression::make(pool, nebula::kVid), VertexID); - newCols->addColumn(vidCol); - } auto &exprProps = fetchCtx_->exprProps; for (auto col : yield->columns()) { diff --git a/src/graph/validator/GoValidator.cpp b/src/graph/validator/GoValidator.cpp index 6cbbbb4df85..8fb323094ef 100644 --- a/src/graph/validator/GoValidator.cpp +++ b/src/graph/validator/GoValidator.cpp @@ -115,27 +115,13 @@ Status GoValidator::validateTruncate(TruncateClause* truncate) { } Status GoValidator::validateYield(YieldClause* yield) { + if (yield == nullptr) { + return Status::SemanticError("Missing yield clause."); + } goCtx_->distinct = yield->isDistinct(); - const auto& over = goCtx_->over; - auto* pool = qctx_->objPool(); auto& exprProps = goCtx_->exprProps; - auto cols = yield->columns(); - if (cols.empty() && over.isOverAll) { - DCHECK(!over.allEdges.empty()); - auto* newCols = pool->add(new YieldColumns()); - for (const auto& e : over.allEdges) { - auto* col = new YieldColumn(EdgeDstIdExpression::make(pool, e)); - newCols->addColumn(col); - outputs_.emplace_back(col->name(), vidType_); - NG_RETURN_IF_ERROR(deduceProps(col->expr(), exprProps)); - } - goCtx_->yieldExpr = newCols; - goCtx_->colNames = getOutColNames(); - return Status::OK(); - } - - for (auto col : cols) { + for (auto col : yield->columns()) { if (ExpressionUtils::hasAny(col->expr(), {Expression::Kind::kAggregate, Expression::Kind::kPathBuild})) { return Status::SemanticError("`%s' is not support in go sentence.", col->toString().c_str()); @@ -169,6 +155,7 @@ Status GoValidator::validateYield(YieldClause* yield) { NG_RETURN_IF_ERROR(deduceProps(colExpr, exprProps)); } + const auto& over = goCtx_->over; for (const auto& e : exprProps.edgeProps()) { auto found = std::find(over.edgeTypes.begin(), over.edgeTypes.end(), e.first); if (found == over.edgeTypes.end()) { diff --git a/src/graph/validator/test/FetchEdgesTest.cpp b/src/graph/validator/test/FetchEdgesTest.cpp index f1140206540..e20f29535fb 100644 --- a/src/graph/validator/test/FetchEdgesTest.cpp +++ b/src/graph/validator/test/FetchEdgesTest.cpp @@ -26,7 +26,7 @@ TEST_F(FetchEdgesValidatorTest, FetchEdgesProp) { auto rank = ColumnExpression::make(pool_.get(), 1); auto dst = ColumnExpression::make(pool_.get(), 2); { - auto qctx = getQCtx("FETCH PROP ON like \"1\"->\"2\""); + auto qctx = getQCtx("FETCH PROP ON like \"1\"->\"2\" YIELD edge as e"); auto *pool = qctx->objPool(); auto *start = StartNode::make(qctx); @@ -44,9 +44,9 @@ TEST_F(FetchEdgesValidatorTest, FetchEdgesProp) { // project auto yieldColumns = std::make_unique(); - yieldColumns->addColumn(new YieldColumn(EdgeExpression::make(pool), "edges_")); + yieldColumns->addColumn(new YieldColumn(EdgeExpression::make(pool), "e")); auto *project = Project::make(qctx, filter, yieldColumns.get()); - project->setColNames({"edges_"}); + project->setColNames({"e"}); auto result = Eq(qctx->plan()->root(), project); ASSERT_TRUE(result.ok()) << result; } @@ -78,17 +78,9 @@ TEST_F(FetchEdgesValidatorTest, FetchEdgesProp) { // Project auto yieldColumns = std::make_unique(); - yieldColumns->addColumn(new YieldColumn(EdgeSrcIdExpression::make(pool, "like"))); - yieldColumns->addColumn(new YieldColumn(EdgeDstIdExpression::make(pool, "like"))); - yieldColumns->addColumn(new YieldColumn(EdgeRankExpression::make(pool, "like"))); yieldColumns->addColumn(new YieldColumn(EdgePropertyExpression::make(pool, "like", "start"))); yieldColumns->addColumn(new YieldColumn(EdgePropertyExpression::make(pool, "like", "end"))); auto *project = Project::make(qctx, filter, yieldColumns.get()); - project->setColNames({std::string("like.") + kSrc, - std::string("like.") + kDst, - std::string("like.") + kRank, - "like.start", - "like.end"}); auto result = Eq(qctx->plan()->root(), project); ASSERT_TRUE(result.ok()) << result; } @@ -121,20 +113,11 @@ TEST_F(FetchEdgesValidatorTest, FetchEdgesProp) { // Project auto yieldColumns = std::make_unique(); - yieldColumns->addColumn(new YieldColumn(EdgeSrcIdExpression::make(pool, "like"))); - yieldColumns->addColumn(new YieldColumn(EdgeDstIdExpression::make(pool, "like"))); - yieldColumns->addColumn(new YieldColumn(EdgeRankExpression::make(pool, "like"))); yieldColumns->addColumn(new YieldColumn(EdgePropertyExpression::make(pool, "like", "start"))); yieldColumns->addColumn(new YieldColumn(ArithmeticExpression::makeAdd( pool, ConstantExpression::make(pool, 1), ConstantExpression::make(pool, 1)))); yieldColumns->addColumn(new YieldColumn(EdgePropertyExpression::make(pool, "like", "end"))); auto *project = Project::make(qctx, filter, yieldColumns.get()); - project->setColNames({std::string("like.") + kSrc, - std::string("like.") + kDst, - std::string("like.") + kRank, - "like.start", - "(1+1)", - "like.end"}); auto result = Eq(qctx->plan()->root(), project); ASSERT_TRUE(result.ok()) << result; } @@ -166,19 +149,11 @@ TEST_F(FetchEdgesValidatorTest, FetchEdgesProp) { // project, TODO(shylock) it's could push-down to storage if it supported auto yieldColumns = std::make_unique(); - yieldColumns->addColumn(new YieldColumn(EdgeSrcIdExpression::make(pool, "like"))); - yieldColumns->addColumn(new YieldColumn(EdgeDstIdExpression::make(pool, "like"))); - yieldColumns->addColumn(new YieldColumn(EdgeRankExpression::make(pool, "like"))); yieldColumns->addColumn(new YieldColumn( RelationalExpression::makeGT(pool, EdgePropertyExpression::make(pool, "like", "start"), EdgePropertyExpression::make(pool, "like", "end")))); auto *project = Project::make(qctx, filter, yieldColumns.get()); - project->setColNames({std::string("like.") + kSrc, - std::string("like.") + kDst, - std::string("like.") + kRank, - "(like.start>like.end)"}); - auto result = Eq(qctx->plan()->root(), project); ASSERT_TRUE(result.ok()) << result; } @@ -206,33 +181,20 @@ TEST_F(FetchEdgesValidatorTest, FetchEdgesProp) { exprs->emplace_back(std::move(expr2)); auto *ge = GetEdges::make(qctx, start, 1, src, type, rank, dst, std::move(props), std::move(exprs)); - - std::vector colNames{std::string("like.") + kSrc, - std::string("like.") + kDst, - std::string("like.") + kRank, - "like.start", - "like.end"}; - - // filter auto *filter = Filter::make(qctx, ge, nullptr /*TODO*/); // project auto yieldColumns = std::make_unique(); - yieldColumns->addColumn(new YieldColumn(EdgeSrcIdExpression::make(pool, "like"))); - yieldColumns->addColumn(new YieldColumn(EdgeDstIdExpression::make(pool, "like"))); - yieldColumns->addColumn(new YieldColumn(EdgeRankExpression::make(pool, "like"))); yieldColumns->addColumn(new YieldColumn(EdgePropertyExpression::make(pool, "like", "start"))); yieldColumns->addColumn(new YieldColumn(EdgePropertyExpression::make(pool, "like", "end"))); auto *project = Project::make(qctx, filter, yieldColumns.get()); - project->setColNames(colNames); - // dedup auto *dedup = Dedup::make(qctx, project); // data collect auto *dataCollect = DataCollect::make(qctx, DataCollect::DCKind::kRowBasedMove); dataCollect->addDep(dedup); dataCollect->setInputVars({dedup->outputVar()}); - dataCollect->setColNames(colNames); + dataCollect->setColNames({"like.start", "like.end"}); auto result = Eq(qctx->plan()->root(), dataCollect); ASSERT_TRUE(result.ok()) << result; @@ -245,7 +207,7 @@ TEST_F(FetchEdgesValidatorTest, FetchEdgesInputOutput) { const std::string query = "$a = FETCH PROP ON like \"1\"->\"2\" " "YIELD like._src AS src, like._dst AS dst, like._rank AS rank;" - "FETCH PROP ON like $a.src->$a.dst"; + "FETCH PROP ON like $a.src->$a.dst YIELD edge as e"; EXPECT_TRUE(checkResult(query, { PlanNode::Kind::kProject, @@ -262,7 +224,7 @@ TEST_F(FetchEdgesValidatorTest, FetchEdgesInputOutput) { const std::string query = "FETCH PROP ON like \"1\"->\"2\" " "YIELD like._src AS src, like._dst AS dst, like._rank AS rank" - " | FETCH PROP ON like $-.src->$-.dst@$-.rank"; + " | FETCH PROP ON like $-.src->$-.dst@$-.rank YIELD edge as e"; EXPECT_TRUE(checkResult(query, { PlanNode::Kind::kProject, @@ -275,8 +237,7 @@ TEST_F(FetchEdgesValidatorTest, FetchEdgesInputOutput) { })); } - // with project - // var + // with project var { const std::string query = "$a = FETCH PROP ON like \"1\"->\"2\" " @@ -347,7 +308,7 @@ TEST_F(FetchEdgesValidatorTest, FetchEdgesPropFailed) { ASSERT_FALSE(validate("FETCH PROP ON like \"1\"->\"2\" YIELD $$.like.start + 1")); // Fetch on multi-edges - ASSERT_FALSE(validate("FETCH PROP ON like, serve \"1\"->\"2\"")); + ASSERT_FALSE(validate("FETCH PROP ON like, serve \"1\"->\"2\" YIELD edge as e")); } TEST_F(FetchEdgesValidatorTest, FetchEdgesInputFailed) { @@ -355,19 +316,19 @@ TEST_F(FetchEdgesValidatorTest, FetchEdgesInputFailed) { ASSERT_FALSE( validate("$a = FETCH PROP ON like \"1\"->\"2\" " "YIELD like._src AS src, like._dst AS dst, like._rank AS rank;" - "FETCH PROP ON like $b.src->$b.dst@$b.rank")); + "FETCH PROP ON like $b.src->$b.dst@$b.rank YIELD edge as e")); // mismatched variable property ASSERT_FALSE( validate("$a = FETCH PROP ON like \"1\"->\"2\" " "YIELD like._src AS src, like._dst AS dst, like._rank AS rank;" - "FETCH PROP ON like $b.src->$b.dst@$b.not_exist_property")); + "FETCH PROP ON like $b.src->$b.dst@$b.not_exist_property YIELD edge as e")); // mismatched input property ASSERT_FALSE( validate("FETCH PROP ON like \"1\"->\"2\" " "YIELD like._src AS src, like._dst AS dst, like._rank AS rank | " - "FETCH PROP ON like $-.src->$-.dst@$-.not_exist_property")); + "FETCH PROP ON like $-.src->$-.dst@$-.not_exist_property YIELD edge as e")); // refer to different variables ASSERT_FALSE( @@ -375,7 +336,7 @@ TEST_F(FetchEdgesValidatorTest, FetchEdgesInputFailed) { "YIELD like._src AS src, like._dst AS dst, like._rank AS rank;" "$b = FETCH PROP ON like \"1\"->\"2\" " "YIELD like._src AS src, like._dst AS dst, like._rank AS rank;" - "FETCH PROP ON like $a.src->$b.dst@$b.rank")); + "FETCH PROP ON like $a.src->$b.dst@$b.rank YIELD edge as e")); } } // namespace graph diff --git a/src/graph/validator/test/FetchVerticesTest.cpp b/src/graph/validator/test/FetchVerticesTest.cpp index 2d83805a4cb..c8f8a53cd4f 100644 --- a/src/graph/validator/test/FetchVerticesTest.cpp +++ b/src/graph/validator/test/FetchVerticesTest.cpp @@ -25,7 +25,7 @@ class FetchVerticesValidatorTest : public ValidatorTestBase { TEST_F(FetchVerticesValidatorTest, FetchVerticesProp) { auto src = ColumnExpression::make(pool_.get(), 0); { - auto qctx = getQCtx("FETCH PROP ON person \"1\""); + auto qctx = getQCtx("FETCH PROP ON person \"1\" YIELD vertex as node"); auto *pool = qctx->objPool(); auto *start = StartNode::make(qctx); @@ -40,14 +40,14 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesProp) { gv->setColNames({nebula::kVid, "person.name", "person.age"}); // project auto yieldColumns = std::make_unique(); - yieldColumns->addColumn(new YieldColumn(VertexExpression::make(pool), "vertices_")); + yieldColumns->addColumn(new YieldColumn(VertexExpression::make(pool), "node")); auto *project = Project::make(qctx, gv, yieldColumns.get()); auto result = Eq(qctx->plan()->root(), project); ASSERT_TRUE(result.ok()) << result; } // multi-tags { - auto qctx = getQCtx("FETCH PROP ON person, book \"1\""); + auto qctx = getQCtx("FETCH PROP ON person, book \"1\" YIELD vertex as node"); auto *pool = qctx->objPool(); auto *start = StartNode::make(qctx); @@ -70,7 +70,7 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesProp) { gv->setColNames({nebula::kVid, "person.name", "person.age", "book.name"}); // project auto yieldColumns = std::make_unique(); - yieldColumns->addColumn(new YieldColumn(VertexExpression::make(pool), "vertices_")); + yieldColumns->addColumn(new YieldColumn(VertexExpression::make(pool), "node")); auto *project = Project::make(qctx, gv, yieldColumns.get()); auto result = Eq(qctx->plan()->root(), project); ASSERT_TRUE(result.ok()) << result; @@ -101,12 +101,10 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesProp) { // project auto yieldColumns = std::make_unique(); - yieldColumns->addColumn( - new YieldColumn(InputPropertyExpression::make(pool, nebula::kVid), "VertexID")); yieldColumns->addColumn(new YieldColumn(TagPropertyExpression::make(pool, "person", "name"))); yieldColumns->addColumn(new YieldColumn(TagPropertyExpression::make(pool, "person", "age"))); auto *project = Project::make(qctx, gv, yieldColumns.get()); - project->setColNames({"VertexID", "person.name", "person.age"}); + project->setColNames({"person.name", "person.age"}); auto result = Eq(qctx->plan()->root(), project); ASSERT_TRUE(result.ok()) << result; @@ -151,13 +149,11 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesProp) { // project auto yieldColumns = std::make_unique(); - yieldColumns->addColumn( - new YieldColumn(InputPropertyExpression::make(pool, nebula::kVid), "VertexID")); yieldColumns->addColumn(new YieldColumn(TagPropertyExpression::make(pool, "person", "name"))); yieldColumns->addColumn(new YieldColumn(TagPropertyExpression::make(pool, "person", "age"))); yieldColumns->addColumn(new YieldColumn(TagPropertyExpression::make(pool, "book", "name"))); auto *project = Project::make(qctx, gv, yieldColumns.get()); - project->setColNames({"VertexID", "person.name", "person.age", "book.name"}); + project->setColNames({"person.name", "person.age", "book.name"}); auto result = Eq(qctx->plan()->root(), project); ASSERT_TRUE(result.ok()) << result; @@ -189,14 +185,12 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesProp) { // project auto yieldColumns = std::make_unique(); - yieldColumns->addColumn( - new YieldColumn(InputPropertyExpression::make(pool, nebula::kVid), "VertexID")); yieldColumns->addColumn(new YieldColumn(TagPropertyExpression::make(pool, "person", "name"))); yieldColumns->addColumn(new YieldColumn(RelationalExpression::makeGT( pool, ConstantExpression::make(pool, 1), ConstantExpression::make(pool, 1)))); yieldColumns->addColumn(new YieldColumn(TagPropertyExpression::make(pool, "person", "age"))); auto *project = Project::make(qctx, gv, yieldColumns.get()); - project->setColNames({"VertexID", "person.name", "(1>1)", "person.age"}); + project->setColNames({"person.name", "(1>1)", "person.age"}); auto result = Eq(qctx->plan()->root(), project); ASSERT_TRUE(result.ok()) << result; @@ -243,15 +237,13 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesProp) { // project auto yieldColumns = std::make_unique(); - yieldColumns->addColumn( - new YieldColumn(InputPropertyExpression::make(pool, nebula::kVid), "VertexID")); yieldColumns->addColumn(new YieldColumn(TagPropertyExpression::make(pool, "person", "name"))); yieldColumns->addColumn(new YieldColumn(RelationalExpression::makeGT( pool, ConstantExpression::make(pool, 1), ConstantExpression::make(pool, 1)))); yieldColumns->addColumn(new YieldColumn(TagPropertyExpression::make(pool, "book", "name"))); yieldColumns->addColumn(new YieldColumn(TagPropertyExpression::make(pool, "person", "age"))); auto *project = Project::make(qctx, gv, yieldColumns.get()); - project->setColNames({"VertexID", "person.name", "(1>1)", "book.name", "person.age"}); + project->setColNames({"person.name", "(1>1)", "book.name", "person.age"}); auto result = Eq(qctx->plan()->root(), project); ASSERT_TRUE(result.ok()) << result; @@ -284,14 +276,12 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesProp) { // project, TODO(shylock) could push down to storage is it supported auto yieldColumns = std::make_unique(); - yieldColumns->addColumn( - new YieldColumn(InputPropertyExpression::make(pool, nebula::kVid), "VertexID")); yieldColumns->addColumn(new YieldColumn( ArithmeticExpression::makeAdd(pool, TagPropertyExpression::make(pool, "person", "name"), TagPropertyExpression::make(pool, "person", "age")))); auto *project = Project::make(qctx, gv, yieldColumns.get()); - project->setColNames({"VertexID", "(person.name+person.age)"}); + project->setColNames({"(person.name+person.age)"}); auto result = Eq(qctx->plan()->root(), project); ASSERT_TRUE(result.ok()) << result; @@ -333,14 +323,12 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesProp) { // project, TODO(shylock) could push down to storage is it supported auto yieldColumns = std::make_unique(); - yieldColumns->addColumn( - new YieldColumn(InputPropertyExpression::make(pool, nebula::kVid), "VertexID")); yieldColumns->addColumn(new YieldColumn( ArithmeticExpression::makeAdd(pool, TagPropertyExpression::make(pool, "person", "name"), TagPropertyExpression::make(pool, "book", "name")))); auto *project = Project::make(qctx, gv, yieldColumns.get()); - project->setColNames({"VertexID", "(person.name+book.name)"}); + project->setColNames({"(person.name+book.name)"}); auto result = Eq(qctx->plan()->root(), project); ASSERT_TRUE(result.ok()) << result; @@ -367,35 +355,28 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesProp) { exprs->emplace_back(std::move(expr1)); exprs->emplace_back(std::move(expr2)); auto *gv = GetVertices::make(qctx, start, 1, src, std::move(props), std::move(exprs)); + gv->setColNames({nebula::kVid, "person.name", "person.age"}); - std::vector colNames{"VertexID", "person.name", "person.age"}; - gv->setColNames(colNames); - - // project auto yieldColumns = std::make_unique(); - yieldColumns->addColumn( - new YieldColumn(InputPropertyExpression::make(pool, nebula::kVid), "VertexID")); yieldColumns->addColumn(new YieldColumn(TagPropertyExpression::make(pool, "person", "name"))); yieldColumns->addColumn(new YieldColumn(TagPropertyExpression::make(pool, "person", "age"))); auto *project = Project::make(qctx, gv, yieldColumns.get()); - project->setColNames(colNames); + project->setColNames({"person.name", "person.age"}); - // dedup auto *dedup = Dedup::make(qctx, project); - dedup->setColNames(colNames); // data collect auto *dataCollect = DataCollect::make(qctx, DataCollect::DCKind::kRowBasedMove); dataCollect->addDep(dedup); dataCollect->setInputVars({dedup->outputVar()}); - dataCollect->setColNames(colNames); + dataCollect->setColNames({"person.name", "person.age"}); auto result = Eq(qctx->plan()->root(), dataCollect); ASSERT_TRUE(result.ok()) << result; } // ON * { - auto qctx = getQCtx("FETCH PROP ON * \"1\""); + auto qctx = getQCtx("FETCH PROP ON * \"1\" YIELD vertex as node"); auto *pool = qctx->objPool(); auto *start = StartNode::make(qctx); @@ -403,13 +384,13 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesProp) { gv->setColNames({nebula::kVid, "person.name", "person.age"}); // project auto yieldColumns = std::make_unique(); - yieldColumns->addColumn(new YieldColumn(VertexExpression::make(pool), "vertices_")); + yieldColumns->addColumn(new YieldColumn(VertexExpression::make(pool), "node")); auto *project = Project::make(qctx, gv, yieldColumns.get()); auto result = Eq(qctx->plan()->root(), project); ASSERT_TRUE(result.ok()) << result; } { - auto qctx = getQCtx("FETCH PROP ON * \"1\", \"2\""); + auto qctx = getQCtx("FETCH PROP ON * \"1\", \"2\" YIELD vertex as node"); auto *pool = qctx->objPool(); auto *start = StartNode::make(qctx); @@ -417,7 +398,7 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesProp) { gv->setColNames({nebula::kVid, "person.name", "person.age"}); // project auto yieldColumns = std::make_unique(); - yieldColumns->addColumn(new YieldColumn(VertexExpression::make(pool), "vertices_")); + yieldColumns->addColumn(new YieldColumn(VertexExpression::make(pool), "node")); auto *project = Project::make(qctx, gv, yieldColumns.get()); auto result = Eq(qctx->plan()->root(), project); ASSERT_TRUE(result.ok()) << result; @@ -428,15 +409,10 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesProp) { auto *pool = qctx->objPool(); auto *start = StartNode::make(qctx); - std::vector colNames{"VertexID", "person.name"}; - // Get vertices auto *gv = GetVertices::make(qctx, start, 1, src); - gv->setColNames(colNames); + gv->setColNames({nebula::kVid, "person.name"}); - // project auto yieldColumns = std::make_unique(); - yieldColumns->addColumn( - new YieldColumn(InputPropertyExpression::make(pool, nebula::kVid), "VertexID")); yieldColumns->addColumn(new YieldColumn(TagPropertyExpression::make(pool, "person", "name"))); auto *project = Project::make(qctx, gv, yieldColumns.get()); @@ -448,15 +424,10 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesProp) { auto *pool = qctx->objPool(); auto *start = StartNode::make(qctx); - std::vector colNames{"VertexID", "person.name", "person.age"}; - // Get vertices auto *gv = GetVertices::make(qctx, start, 1, src); - gv->setColNames(colNames); + gv->setColNames({nebula::kVid, "person.name", "person.age"}); - // project auto yieldColumns = std::make_unique(); - yieldColumns->addColumn( - new YieldColumn(InputPropertyExpression::make(pool, nebula::kVid), "VertexID")); yieldColumns->addColumn(new YieldColumn(TagPropertyExpression::make(pool, "person", "name"))); yieldColumns->addColumn(new YieldColumn(TagPropertyExpression::make(pool, "person", "age"))); auto *project = Project::make(qctx, gv, yieldColumns.get()); @@ -469,14 +440,10 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesProp) { auto *pool = qctx->objPool(); auto *start = StartNode::make(qctx); - // Get vertices auto *gv = GetVertices::make(qctx, start, 1, src); gv->setColNames({nebula::kVid, "person.name", "person.age"}); - // project auto yieldColumns = std::make_unique(); - yieldColumns->addColumn( - new YieldColumn(InputPropertyExpression::make(pool, nebula::kVid), "VertexID")); yieldColumns->addColumn(new YieldColumn(ArithmeticExpression::makeAdd( pool, ConstantExpression::make(pool, 1), ConstantExpression::make(pool, 1)))); yieldColumns->addColumn(new YieldColumn(TagPropertyExpression::make(pool, "person", "name"))); @@ -492,8 +459,8 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesInputOutput) { // pipe { const std::string query = - "FETCH PROP ON person \"1\" YIELD person.name AS name" - " | FETCH PROP ON person $-.name"; + "FETCH PROP ON person \"1\" YIELD person.name AS name |" + "FETCH PROP ON person $-.name YIELD vertex as node"; EXPECT_TRUE(checkResult(query, { PlanNode::Kind::kProject, @@ -506,8 +473,8 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesInputOutput) { { // with multi-tags const std::string query = - "FETCH PROP ON person \"1\" YIELD person.name AS name" - " | FETCH PROP ON person, book $-.name"; + "FETCH PROP ON person \"1\" YIELD person.name AS name |" + "FETCH PROP ON person, book $-.name YIELD vertex as node"; EXPECT_TRUE(checkResult(query, { PlanNode::Kind::kProject, @@ -521,7 +488,7 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesInputOutput) { { const std::string query = "$a = FETCH PROP ON person \"1\" YIELD person.name AS name;" - "FETCH PROP ON person $a.name"; + "FETCH PROP ON person $a.name YIELD vertex as node"; EXPECT_TRUE(checkResult(query, { PlanNode::Kind::kProject, @@ -535,7 +502,7 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesInputOutput) { // with multi-tags const std::string query = "$a = FETCH PROP ON person \"1\" YIELD person.name AS name;" - "FETCH PROP ON book,person $a.name"; + "FETCH PROP ON book,person $a.name YIELD vertex as node"; EXPECT_TRUE(checkResult(query, { PlanNode::Kind::kProject, @@ -545,9 +512,6 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesInputOutput) { PlanNode::Kind::kStart, })); } - - // with project - // pipe { const std::string query = "FETCH PROP ON person \"1\" YIELD person.name + 1 AS name" @@ -607,7 +571,7 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesInputOutput) { { const std::string query = "FETCH PROP ON person \"1\", \"2\" YIELD person.name AS name" - "| FETCH PROP ON * $-.name"; + "| FETCH PROP ON * $-.name YIELD vertex as node"; EXPECT_TRUE(checkResult(query, { PlanNode::Kind::kProject, @@ -620,7 +584,7 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesInputOutput) { { const std::string query = "$a = FETCH PROP ON person \"1\", \"2\" YIELD person.name AS name;" - "FETCH PROP ON * $a.name"; + "FETCH PROP ON * $a.name YIELD vertex as node"; EXPECT_TRUE(checkResult(query, { PlanNode::Kind::kProject, @@ -634,7 +598,7 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesInputOutput) { { const std::string query = "FETCH PROP ON * \"1\", \"2\" YIELD person.name AS name" - "| FETCH PROP ON * $-.name"; + "| FETCH PROP ON * $-.name YIELD vertex as node"; EXPECT_TRUE(checkResult(query, { PlanNode::Kind::kProject, @@ -647,7 +611,7 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesInputOutput) { { const std::string query = "$a = FETCH PROP ON * \"1\", \"2\" YIELD person.name AS name;" - "FETCH PROP ON * $a.name"; + "FETCH PROP ON * $a.name YIELD vertex as node"; EXPECT_TRUE(checkResult(query, { PlanNode::Kind::kProject, @@ -713,26 +677,26 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesInputFailed) { // mismatched varirable ASSERT_FALSE( validate("$a = FETCH PROP ON person \"1\" YIELD person.name AS name;" - "FETCH PROP ON person $b.name")); + "FETCH PROP ON person $b.name YIELD vertex as node")); ASSERT_FALSE( validate("$a = FETCH PROP ON * \"1\" YIELD person.name AS name;" - "FETCH PROP * person $b.name")); + "FETCH PROP * person $b.name YIELD vertex as node")); // mismatched varirable property ASSERT_FALSE( validate("$a = FETCH PROP ON person \"1\" YIELD person.name AS name;" - "FETCH PROP ON person $a.not_exist_property")); + "FETCH PROP ON person $a.not_exist_property YIELD vertex as node")); ASSERT_FALSE( validate("$a = FETCH PROP * person \"1\" YIELD person.name AS name;" - "FETCH PROP * person $a.not_exist_property")); + "FETCH PROP * person $a.not_exist_property YIELD vertex as node")); // mismatched input property ASSERT_FALSE( validate("FETCH PROP ON person \"1\" YIELD person.name AS name | " - "FETCH PROP ON person $-.not_exist_property")); + "FETCH PROP ON person $-.not_exist_property YIELD vertex as node")); ASSERT_FALSE( validate("FETCH PROP * person \"1\" YIELD person.name AS name | " - "FETCH PROP * person $-.not_exist_property")); + "FETCH PROP * person $-.not_exist_property YIELD vertex as node")); } } // namespace graph diff --git a/src/graph/validator/test/LookupValidatorTest.cpp b/src/graph/validator/test/LookupValidatorTest.cpp index be9389db527..cf13198fe19 100644 --- a/src/graph/validator/test/LookupValidatorTest.cpp +++ b/src/graph/validator/test/LookupValidatorTest.cpp @@ -20,7 +20,7 @@ TEST_F(LookupValidatorTest, InputOutput) { { const std::string query = "LOOKUP ON person where person.age == 35 | " - "FETCH PROP ON person $-.VertexID"; + "FETCH PROP ON person $-.VertexID YIELD vertex as node"; EXPECT_TRUE(checkResult(query, { PlanNode::Kind::kProject, @@ -35,7 +35,7 @@ TEST_F(LookupValidatorTest, InputOutput) { { const std::string query = "LOOKUP ON person where person.age == 35 YIELD person.name AS name | " - "FETCH PROP ON person $-.name"; + "FETCH PROP ON person $-.name YIELD vertex as node"; EXPECT_TRUE(checkResult(query, { PlanNode::Kind::kProject, @@ -50,7 +50,7 @@ TEST_F(LookupValidatorTest, InputOutput) { { const std::string query = "$a = LOOKUP ON person where person.age == 35; " - "FETCH PROP ON person $a.VertexID"; + "FETCH PROP ON person $a.VertexID YIELD vertex as node"; EXPECT_TRUE(checkResult(query, { PlanNode::Kind::kProject, @@ -66,7 +66,7 @@ TEST_F(LookupValidatorTest, InputOutput) { const std::string query = "$a = LOOKUP ON person where person.age == 35 YIELD person.name AS " "name;" - "FETCH PROP ON person $a.name"; + "FETCH PROP ON person $a.name YIELD vertex as node"; EXPECT_TRUE(checkResult(query, { PlanNode::Kind::kProject, diff --git a/src/graph/validator/test/QueryValidatorTest.cpp b/src/graph/validator/test/QueryValidatorTest.cpp index d15f49b5767..2a66c0b0d29 100644 --- a/src/graph/validator/test/QueryValidatorTest.cpp +++ b/src/graph/validator/test/QueryValidatorTest.cpp @@ -49,14 +49,14 @@ TEST_F(QueryValidatorTest, TestFirstSentence) { TEST_F(QueryValidatorTest, GoZeroStep) { { - std::string query = "GO 0 STEPS FROM \"1\" OVER serve"; + std::string query = "GO 0 STEPS FROM \"1\" OVER serve YIELD edge as e"; std::vector expected = {PK::kPassThrough, PK::kStart}; EXPECT_TRUE(checkResult(query, expected)); } { std::string query = "GO 0 STEPS FROM \"1\" OVER like YIELD like._dst as id" - "| GO FROM $-.id OVER serve"; + "| GO FROM $-.id OVER serve YIELD edge as e"; std::vector expected = {PK::kProject, PK::kInnerJoin, PK::kProject, @@ -68,7 +68,7 @@ TEST_F(QueryValidatorTest, GoZeroStep) { EXPECT_TRUE(checkResult(query, expected)); } { - std::string query = "GO 0 TO 0 STEPS FROM \"1\" OVER serve"; + std::string query = "GO 0 TO 0 STEPS FROM \"1\" OVER serve YIELD $$ as dst"; std::vector expected = {PK::kPassThrough, PK::kStart}; EXPECT_TRUE(checkResult(query, expected)); } @@ -76,7 +76,7 @@ TEST_F(QueryValidatorTest, GoZeroStep) { TEST_F(QueryValidatorTest, GoNSteps) { { - std::string query = "GO 2 STEPS FROM \"1\" OVER like"; + std::string query = "GO 2 STEPS FROM \"1\" OVER like YIELD $^ as src"; std::vector expected = {PK::kProject, PK::kGetNeighbors, PK::kLoop, @@ -88,7 +88,8 @@ TEST_F(QueryValidatorTest, GoNSteps) { EXPECT_TRUE(checkResult(query, expected)); } { - std::string query = "GO 3 STEPS FROM \"1\",\"2\",\"3\" OVER like WHERE like.likeness > 90"; + std::string query = + "GO 3 STEPS FROM \"1\",\"2\",\"3\" OVER like WHERE like.likeness > 90 YIELD $^ as src"; std::vector expected = { PK::kProject, PK::kFilter, @@ -144,7 +145,7 @@ TEST_F(QueryValidatorTest, GoWithPipe) { { std::string query = "GO 1 STEPS FROM \"1\" OVER like YIELD like._dst AS " - "id | GO 2 STEPS FROM $-.id OVER like"; + "id | GO 2 STEPS FROM $-.id OVER like YIELD edge as e"; std::vector expected = { PK::kProject, PK::kInnerJoin, PK::kInnerJoin, PK::kProject, PK::kGetNeighbors, PK::kLoop, PK::kDedup, PK::kDedup, PK::kProject, PK::kProject, @@ -156,7 +157,7 @@ TEST_F(QueryValidatorTest, GoWithPipe) { { std::string query = "GO 2 STEPS FROM \"1\" OVER like YIELD like._dst AS id" - "| GO 1 STEPS FROM $-.id OVER like"; + "| GO 1 STEPS FROM $-.id OVER like YIELD src(edge) as src"; std::vector expected = {PK::kProject, PK::kInnerJoin, PK::kProject, @@ -174,7 +175,7 @@ TEST_F(QueryValidatorTest, GoWithPipe) { EXPECT_TRUE(checkResult(query, expected)); } { - std::string query = "YIELD \"1\" AS id | GO FROM $-.id OVER like"; + std::string query = "YIELD \"1\" AS id | GO FROM $-.id OVER like YIELD id($^) as id"; std::vector expected = {PK::kProject, PK::kInnerJoin, PK::kProject, @@ -423,9 +424,7 @@ TEST_F(QueryValidatorTest, GoWithVariable) { TEST_F(QueryValidatorTest, GoReversely) { { - std::string query = - "GO FROM \"1\" OVER like REVERSELY " - "YIELD $$.person.name"; + std::string query = "GO FROM \"1\" OVER like REVERSELY YIELD $$.person.name"; std::vector expected = { PK::kProject, PK::kLeftJoin, @@ -438,9 +437,7 @@ TEST_F(QueryValidatorTest, GoReversely) { EXPECT_TRUE(checkResult(query, expected)); } { - std::string query = - "GO 2 STEPS FROM \"1\" OVER like REVERSELY " - "YIELD $$.person.name"; + std::string query = "GO 2 STEPS FROM \"1\" OVER like REVERSELY YIELD $$.person.name"; std::vector expected = { PK::kProject, PK::kLeftJoin, @@ -461,7 +458,7 @@ TEST_F(QueryValidatorTest, GoReversely) { TEST_F(QueryValidatorTest, GoBidirectly) { { - std::string query = "GO FROM \"1\" OVER like BIDIRECT"; + std::string query = "GO FROM \"1\" OVER like BIDIRECT YIELD edge as e"; std::vector expected = { PK::kProject, PK::kGetNeighbors, @@ -488,7 +485,7 @@ TEST_F(QueryValidatorTest, GoBidirectly) { TEST_F(QueryValidatorTest, GoOneStep) { { - std::string query = "GO FROM \"1\" OVER like"; + std::string query = "GO FROM \"1\" OVER like YIELD src(edge) as src"; std::vector expected = { PK::kProject, PK::kGetNeighbors, @@ -497,7 +494,7 @@ TEST_F(QueryValidatorTest, GoOneStep) { EXPECT_TRUE(checkResult(query, expected)); } { - std::string query = "GO FROM \"1\" OVER like REVERSELY"; + std::string query = "GO FROM \"1\" OVER like REVERSELY YIELD dst(edge) as dst"; std::vector expected = { PK::kProject, PK::kGetNeighbors, @@ -506,7 +503,7 @@ TEST_F(QueryValidatorTest, GoOneStep) { EXPECT_TRUE(checkResult(query, expected)); } { - std::string query = "GO FROM \"1\" OVER like BIDIRECT"; + std::string query = "GO FROM \"1\" OVER like BIDIRECT YIELD dst(edge) as dst"; std::vector expected = { PK::kProject, PK::kGetNeighbors, @@ -604,7 +601,7 @@ TEST_F(QueryValidatorTest, GoOneStep) { EXPECT_TRUE(checkResult(query, expected)); } { - std::string query = "GO FROM \"1\",\"2\",\"3\" OVER like"; + std::string query = "GO FROM \"1\",\"2\",\"3\" OVER like YIELD edge as e"; std::vector expected = { PK::kProject, PK::kGetNeighbors, @@ -613,7 +610,8 @@ TEST_F(QueryValidatorTest, GoOneStep) { EXPECT_TRUE(checkResult(query, expected)); } { - std::string query = "GO FROM \"1\",\"2\",\"3\" OVER like WHERE like.likeness > 90"; + std::string query = + "GO FROM \"1\",\"2\",\"3\" OVER like WHERE like.likeness > 90 YIELD edge as e"; std::vector expected = { PK::kProject, PK::kFilter, @@ -637,7 +635,8 @@ TEST_F(QueryValidatorTest, GoOneStep) { EXPECT_TRUE(checkResult(query, expected)); } { - std::string query = "GO FROM \"1\",\"2\",\"3\" OVER like WHERE $^.person.name == \"me\""; + std::string query = + "GO FROM \"1\",\"2\",\"3\" OVER like WHERE $^.person.name == \"me\" YIELD edge as e"; std::vector expected = { PK::kProject, PK::kFilter, @@ -649,7 +648,7 @@ TEST_F(QueryValidatorTest, GoOneStep) { { std::string query = "GO FROM \"1\" OVER like YIELD like._dst AS id" - "| GO FROM $-.id OVER like"; + "| GO FROM $-.id OVER like YIELD dst(edge) as dst"; std::vector expected = { PK::kProject, PK::kInnerJoin, @@ -667,9 +666,7 @@ TEST_F(QueryValidatorTest, GoOneStep) { TEST_F(QueryValidatorTest, GoOverAll) { { - std::string query = - "GO FROM \"1\" OVER * REVERSELY " - "YIELD serve._src, like._src"; + std::string query = "GO FROM \"1\" OVER * REVERSELY YIELD serve._src, like._src"; std::vector expected = { PK::kProject, PK::kGetNeighbors, @@ -678,7 +675,7 @@ TEST_F(QueryValidatorTest, GoOverAll) { EXPECT_TRUE(checkResult(query, expected)); } { - std::string query = "GO FROM \"1\" OVER * REVERSELY"; + std::string query = "GO FROM \"1\" OVER * REVERSELY YIELD edge as e"; std::vector expected = { PK::kProject, PK::kGetNeighbors, @@ -687,7 +684,7 @@ TEST_F(QueryValidatorTest, GoOverAll) { EXPECT_TRUE(checkResult(query, expected)); } { - std::string query = "GO FROM \"1\" OVER *"; + std::string query = "GO FROM \"1\" OVER * YIELD src(edge) as src"; std::vector expected = { PK::kProject, PK::kGetNeighbors, @@ -715,7 +712,7 @@ TEST_F(QueryValidatorTest, OutputToAPipe) { std::string query = "GO FROM '1' OVER like YIELD like._dst as id " "| ( GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id " - "OVER serve )"; + "OVER serve YIELD dst(edge) as dst )"; std::vector expected = { PK::kProject, PK::kInnerJoin, @@ -874,35 +871,30 @@ TEST_F(QueryValidatorTest, GoMToN) { TEST_F(QueryValidatorTest, GoInvalid) { { // friend not exist. - std::string query = "GO FROM \"1\" OVER friend"; + std::string query = "GO FROM \"1\" OVER friend YIELD $$ as dst"; EXPECT_FALSE(checkResult(query)); } { // manager not exist - std::string query = - "GO FROM \"1\" OVER like " - "YIELD $^.manager.name,$^.person.age"; + std::string query = "GO FROM \"1\" OVER like YIELD $^.manager.name,$^.person.age"; EXPECT_FALSE(checkResult(query)); } { // manager not exist - std::string query = - "GO FROM \"1\" OVER like " - "YIELD $$.manager.name,$$.person.age"; + std::string query = "GO FROM \"1\" OVER like YIELD $$.manager.name,$$.person.age"; EXPECT_FALSE(checkResult(query)); } { // column not exist std::string query = - "GO FROM \"1\" OVER like YIELD like._dst AS id" - "| GO FROM $-.col OVER like"; + "GO FROM \"1\" OVER like YIELD like._dst AS id | GO FROM $-.col OVER like YIELD edge as e"; EXPECT_FALSE(checkResult(query)); } { // invalid id type std::string query = "GO FROM \"1\" OVER like YIELD like.likeness AS id" - "| GO FROM $-.id OVER like"; + "| GO FROM $-.id OVER like YIELD edge as e"; EXPECT_FALSE(checkResult(query)); } { @@ -910,7 +902,7 @@ TEST_F(QueryValidatorTest, GoInvalid) { std::string query = "$var = GO FROM \"2\" OVER like;" "GO FROM \"1\" OVER like YIELD like._dst AS id" - "| GO FROM $-.id OVER like WHERE $var.id == \"\""; + "| GO FROM $-.id OVER like WHERE $var.id == \"\" YIELD edge as e"; EXPECT_FALSE(checkResult(query)); } { @@ -923,21 +915,21 @@ TEST_F(QueryValidatorTest, GoInvalid) { { std::string query = "GO FROM \"1\" OVER like YIELD like._dst AS id, like._src AS id | GO " - "FROM $-.id OVER like"; + "FROM $-.id OVER like YIELD like._dst as dst"; auto result = checkResult(query); EXPECT_EQ(std::string(result.message()), "SemanticError: Duplicate Column Name : `id'"); } { std::string query = "$a = GO FROM \"1\" OVER like YIELD like._dst AS id, like._src AS id; " - "GO FROM $a.id OVER like"; + "GO FROM $a.id OVER like YIELD dst(edge) as dst"; auto result = checkResult(query); EXPECT_EQ(std::string(result.message()), "SemanticError: Duplicate Column Name : `id'"); } { std::string query = "GO FROM \"1\" OVER like, serve YIELD like._dst AS id, serve._src AS " - "id, serve._dst AS DST | GO FROM $-.DST OVER like"; + "id, serve._dst AS DST | GO FROM $-.DST OVER like YIELD $$ as dstNode"; auto result = checkResult(query); EXPECT_EQ(std::string(result.message()), "SemanticError: Duplicate Column Name : `id'"); } @@ -945,12 +937,12 @@ TEST_F(QueryValidatorTest, GoInvalid) { std::string query = "$a = GO FROM \"1\" OVER * YIELD like._dst AS id, like._src AS id, " "serve._dst as DST; " - "GO FROM $a.DST OVER like"; + "GO FROM $a.DST OVER like YIELD $^ as srcNode"; auto result = checkResult(query); EXPECT_EQ(std::string(result.message()), "SemanticError: Duplicate Column Name : `id'"); } { - std::string query = "GO FROM id(vertex) OVER * "; + std::string query = "GO FROM id(vertex) OVER * YIELD edge as e"; auto result = checkResult(query); EXPECT_EQ(std::string(result.message()), "SemanticError: `id(VERTEX)' is not an evaluable expression."); diff --git a/src/graph/validator/test/SymbolsTest.cpp b/src/graph/validator/test/SymbolsTest.cpp index c904b4c2b2a..d3a35ef92bd 100644 --- a/src/graph/validator/test/SymbolsTest.cpp +++ b/src/graph/validator/test/SymbolsTest.cpp @@ -44,7 +44,7 @@ TEST_F(SymbolsTest, Variables) { { std::string query = "GO 1 STEPS FROM \"1\" OVER like YIELD like._dst AS " - "id | GO 2 STEPS FROM $-.id OVER like"; + "id | GO 2 STEPS FROM $-.id OVER like YIELD like._dst"; auto status = validate(query); EXPECT_TRUE(status.ok()); auto qctx = std::move(status).value(); diff --git a/src/graph/validator/test/YieldValidatorTest.cpp b/src/graph/validator/test/YieldValidatorTest.cpp index 63bae62a91f..4e6c2ce6713 100644 --- a/src/graph/validator/test/YieldValidatorTest.cpp +++ b/src/graph/validator/test/YieldValidatorTest.cpp @@ -554,7 +554,7 @@ TEST_F(YieldValidatorTest, AggCall) { } // Yield field has not input { - auto query = "GO FROM \"1\" OVER like | YIELD COUNT(*)"; + auto query = "GO FROM \"1\" OVER like YIELD edge as e| YIELD COUNT(*)"; expected_ = { PlanNode::Kind::kAggregate, PlanNode::Kind::kProject, @@ -565,7 +565,7 @@ TEST_F(YieldValidatorTest, AggCall) { } // Yield field has not input { - auto query = "GO FROM \"1\" OVER like | YIELD 1"; + auto query = "GO FROM \"1\" OVER like YIELD edge as e| YIELD 1"; expected_ = { PlanNode::Kind::kProject, PlanNode::Kind::kProject, diff --git a/src/parser/parser.yy b/src/parser/parser.yy index 6588ed35041..e6eb5dc2ec9 100644 --- a/src/parser/parser.yy +++ b/src/parser/parser.yy @@ -1244,17 +1244,6 @@ truncate_clause go_sentence : KW_GO step_clause from_clause over_clause where_clause yield_clause truncate_clause { auto go = new GoSentence($2, $3, $4, $5, $7); - if ($6 == nullptr) { - auto *cols = new YieldColumns(); - if (!$4->isOverAll()) { - for (auto e : $4->edges()) { - auto *expr = EdgeDstIdExpression::make(qctx->objPool(), *e->edge()); - auto *col = new YieldColumn(expr); - cols->addColumn(col); - } - } - $6 = new YieldClause(cols); - } go->setYieldClause($6); $$ = go; } diff --git a/tests/admin/test_permission.py b/tests/admin/test_permission.py index 96152cfbb48..b19d6155e90 100644 --- a/tests/admin/test_permission.py +++ b/tests/admin/test_permission.py @@ -573,7 +573,7 @@ def test_schema_and_data(self): resp = self.dbaClient.execute(query) self.check_resp_succeeded(resp) - query = 'GO FROM "1" OVER e1'; + query = 'GO FROM "1" OVER e1 YIELD e1._dst'; resp = self.dbaClient.execute(query) self.check_resp_succeeded(resp) @@ -590,7 +590,7 @@ def test_schema_and_data(self): resp = self.adminClient.execute(query) self.check_resp_succeeded(resp) - query = 'GO FROM "1" OVER e1'; + query = 'GO FROM "1" OVER e1 YIELD e1._dst'; resp = self.adminClient.execute(query) self.check_resp_succeeded(resp) @@ -607,7 +607,7 @@ def test_schema_and_data(self): resp = self.dbaClient.execute(query) self.check_resp_succeeded(resp) - query = 'GO FROM "1" OVER e1'; + query = 'GO FROM "1" OVER e1 YIELD e1._dst'; resp = self.dbaClient.execute(query) self.check_resp_succeeded(resp) @@ -624,7 +624,7 @@ def test_schema_and_data(self): resp = self.userClient.execute(query) self.check_resp_succeeded(resp) - query = 'GO FROM "1" OVER e1'; + query = 'GO FROM "1" OVER e1 YIELD e1._dst'; resp = self.userClient.execute(query) self.check_resp_succeeded(resp) @@ -641,7 +641,7 @@ def test_schema_and_data(self): resp = self.guestClient.execute(query) self.check_resp_failed(resp, ttypes.ErrorCode.E_BAD_PERMISSION) - query = 'GO FROM "1" OVER e1'; + query = 'GO FROM "1" OVER e1 YIELD e1._dst'; resp = self.guestClient.execute(query) self.check_resp_succeeded(resp) diff --git a/tests/query/stateless/test_go.py b/tests/query/stateless/test_go.py index cf4b3c6fe0b..2cd62a74830 100644 --- a/tests/query/stateless/test_go.py +++ b/tests/query/stateless/test_go.py @@ -151,8 +151,7 @@ def test_2_steps(self): self.check_resp_succeeded(resp) self.check_out_of_order_result(resp, expect_result) - # go 2 steps without YIELD - cmd = 'GO 2 STEPS FROM "1016" OVER is_friend;' + cmd = 'GO 2 STEPS FROM "1016" OVER is_friend YIELD is_friend._dst;' resp = self.execute(cmd) expect_result = [["1016"], ["1020"]] self.check_resp_succeeded(resp) diff --git a/tests/tck/features/aggregate/Agg.feature b/tests/tck/features/aggregate/Agg.feature index 81be9fd36d3..7ddcee6305a 100644 --- a/tests/tck/features/aggregate/Agg.feature +++ b/tests/tck/features/aggregate/Agg.feature @@ -694,7 +694,7 @@ Feature: Basic Aggregate and GroupBy Then a SemanticError should be raised at runtime: `count(*)' is not support in go sentence. When executing query: """ - GO FROM "Tim Duncan" OVER like where COUNT(*) > 2 + GO FROM "Tim Duncan" OVER like where COUNT(*) > 2 YIELD like._dst """ Then a SemanticError should be raised at runtime: `(COUNT(*)>2)', not support aggregate function in where sentence. When executing query: diff --git a/tests/tck/features/bugfix/TestYieldConstantAfterPipe.feature b/tests/tck/features/bugfix/TestYieldConstantAfterPipe.feature index c589b47bea3..01dfffce7f1 100644 --- a/tests/tck/features/bugfix/TestYieldConstantAfterPipe.feature +++ b/tests/tck/features/bugfix/TestYieldConstantAfterPipe.feature @@ -10,7 +10,7 @@ Feature: Test yield constant after pipe Scenario: yield constant after pipe When executing query: """ - GO FROM "Tim Duncan" OVER * | YIELD 1 AS a; + GO FROM "Tim Duncan" OVER * YIELD dst(edge) | YIELD 1 AS a; """ Then the result should be, in any order: | a | @@ -23,7 +23,7 @@ Feature: Test yield constant after pipe | 1 | When executing query: """ - GO FROM "Tim Duncan" OVER * | YIELD 1 AS a WHERE true; + GO FROM "Tim Duncan" OVER * YIELD dst(edge) | YIELD 1 AS a WHERE true; """ Then the result should be, in any order: | a | @@ -36,7 +36,7 @@ Feature: Test yield constant after pipe | 1 | When executing query: """ - GO FROM "Tim Duncan" OVER * | YIELD 1 AS a WHERE false; + GO FROM "Tim Duncan" OVER * YIELD dst(edge) | YIELD 1 AS a WHERE false; """ Then the result should be, in any order: | a | diff --git a/tests/tck/features/delete/DeleteEdge.IntVid.feature b/tests/tck/features/delete/DeleteEdge.IntVid.feature index b76964d1f26..da79c3cd227 100644 --- a/tests/tck/features/delete/DeleteEdge.IntVid.feature +++ b/tests/tck/features/delete/DeleteEdge.IntVid.feature @@ -147,7 +147,7 @@ Feature: Delete int vid of edge # delete with pipe, get result by go When executing query: """ - GO FROM hash("Boris Diaw") OVER like + GO FROM hash("Boris Diaw") OVER like YIELD like._dst """ Then the result should be, in any order, and the columns 0 should be hashed: | like._dst | @@ -162,14 +162,14 @@ Feature: Delete int vid of edge Then the execution should be successful When executing query: """ - GO FROM hash("Boris Diaw") OVER like + GO FROM hash("Boris Diaw") OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | # delete with var, get result by go When executing query: """ - GO FROM hash("Russell Westbrook") OVER like + GO FROM hash("Russell Westbrook") OVER like YIELD like._dst """ Then the result should be, in any order, and the columns 0 should be hashed: | like._dst | @@ -184,7 +184,7 @@ Feature: Delete int vid of edge Then the execution should be successful When executing query: """ - GO FROM hash("Russell Westbrook") OVER like + GO FROM hash("Russell Westbrook") OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | diff --git a/tests/tck/features/delete/DeleteEdge.feature b/tests/tck/features/delete/DeleteEdge.feature index 164d5114148..a528c5ec420 100644 --- a/tests/tck/features/delete/DeleteEdge.feature +++ b/tests/tck/features/delete/DeleteEdge.feature @@ -147,7 +147,7 @@ Feature: Delete string vid of edge # delete with pipe, get result by go When executing query: """ - GO FROM "Boris Diaw" OVER like + GO FROM "Boris Diaw" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -162,14 +162,14 @@ Feature: Delete string vid of edge Then the execution should be successful When executing query: """ - GO FROM "Boris Diaw" OVER like + GO FROM "Boris Diaw" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | # delete with var, get result by go When executing query: """ - GO FROM "Russell Westbrook" OVER like + GO FROM "Russell Westbrook" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -184,7 +184,7 @@ Feature: Delete string vid of edge Then the execution should be successful When executing query: """ - GO FROM "Russell Westbrook" OVER like + GO FROM "Russell Westbrook" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | diff --git a/tests/tck/features/delete/DeleteTag.IntVid.feature b/tests/tck/features/delete/DeleteTag.IntVid.feature index 2b10710ef8a..a52a2fe49b8 100644 --- a/tests/tck/features/delete/DeleteTag.IntVid.feature +++ b/tests/tck/features/delete/DeleteTag.IntVid.feature @@ -12,16 +12,16 @@ Feature: Delete int vid of tag """ FETCH PROP ON player hash("Tim Duncan") YIELD player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | - | "Tim Duncan" | "Tim Duncan" | 42 | + Then the result should be, in any order: + | player.name | player.age | + | "Tim Duncan" | 42 | When executing query: """ FETCH PROP ON bachelor hash("Tim Duncan") YIELD bachelor.name, bachelor.speciality """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | bachelor.name | bachelor.speciality | - | "Tim Duncan" | "Tim Duncan" | "psychology" | + Then the result should be, in any order: + | bachelor.name | bachelor.speciality | + | "Tim Duncan" | "psychology" | When executing query: """ LOOKUP ON player WHERE player.name == "Tim Duncan" @@ -40,15 +40,15 @@ Feature: Delete int vid of tag """ FETCH PROP ON player hash("Tim Duncan") YIELD player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | + Then the result should be, in any order: + | player.name | player.age | When executing query: """ FETCH PROP ON bachelor hash("Tim Duncan") YIELD bachelor.name, bachelor.speciality """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | bachelor.name | bachelor.speciality | - | "Tim Duncan" | "Tim Duncan" | "psychology" | + Then the result should be, in any order: + | bachelor.name | bachelor.speciality | + | "Tim Duncan" | "psychology" | When executing query: """ LOOKUP ON player WHERE player.name == "Tim Duncan" @@ -65,16 +65,16 @@ Feature: Delete int vid of tag """ FETCH PROP ON player hash("Tim Duncan") YIELD player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | - | "Tim Duncan" | "Tim Duncan" | 42 | + Then the result should be, in any order: + | player.name | player.age | + | "Tim Duncan" | 42 | When executing query: """ FETCH PROP ON bachelor hash("Tim Duncan") YIELD bachelor.name, bachelor.speciality """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | bachelor.name | bachelor.speciality | - | "Tim Duncan" | "Tim Duncan" | "psychology" | + Then the result should be, in any order: + | bachelor.name | bachelor.speciality | + | "Tim Duncan" | "psychology" | When executing query: """ LOOKUP ON player WHERE player.name == "Tim Duncan" @@ -93,14 +93,14 @@ Feature: Delete int vid of tag """ FETCH PROP ON player hash("Tim Duncan") YIELD player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | + Then the result should be, in any order: + | player.name | player.age | When executing query: """ FETCH PROP ON bachelor hash("Tim Duncan") YIELD bachelor.name, bachelor.speciality """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | bachelor.name | bachelor.speciality | + Then the result should be, in any order: + | bachelor.name | bachelor.speciality | When executing query: """ LOOKUP ON player WHERE player.name == "Tim Duncan" @@ -117,16 +117,16 @@ Feature: Delete int vid of tag """ FETCH PROP ON player hash("Tim Duncan") YIELD player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | - | "Tim Duncan" | "Tim Duncan" | 42 | + Then the result should be, in any order: + | player.name | player.age | + | "Tim Duncan" | 42 | When executing query: """ FETCH PROP ON bachelor hash("Tim Duncan") YIELD bachelor.name, bachelor.speciality """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | bachelor.name | bachelor.speciality | - | "Tim Duncan" | "Tim Duncan" | "psychology" | + Then the result should be, in any order: + | bachelor.name | bachelor.speciality | + | "Tim Duncan" | "psychology" | When executing query: """ LOOKUP ON player WHERE player.name == "Tim Duncan" @@ -145,14 +145,14 @@ Feature: Delete int vid of tag """ FETCH PROP ON player hash("Tim Duncan") YIELD player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | + Then the result should be, in any order: + | player.name | player.age | When executing query: """ FETCH PROP ON bachelor hash("Tim Duncan") YIELD bachelor.name, bachelor.speciality """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | bachelor.name | bachelor.speciality | + Then the result should be, in any order: + | bachelor.name | bachelor.speciality | When executing query: """ LOOKUP ON player WHERE player.name == "Tim Duncan" @@ -169,16 +169,16 @@ Feature: Delete int vid of tag """ FETCH PROP ON player hash("Tim Duncan") YIELD player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | - | "Tim Duncan" | "Tim Duncan" | 42 | + Then the result should be, in any order: + | player.name | player.age | + | "Tim Duncan" | 42 | When executing query: """ FETCH PROP ON player hash("Tony Parker") YIELD player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | - | "Tony Parker" | "Tony Parker" | 36 | + Then the result should be, in any order: + | player.name | player.age | + | "Tony Parker" | 36 | When executing query: """ LOOKUP ON player WHERE player.name == "Tim Duncan" @@ -204,14 +204,14 @@ Feature: Delete int vid of tag """ FETCH PROP ON player hash("Tim Duncan") YIELD player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | + Then the result should be, in any order: + | player.name | player.age | When executing query: """ FETCH PROP ON player hash("Tony Parker") YIELD player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | + Then the result should be, in any order: + | player.name | player.age | When executing query: """ LOOKUP ON player WHERE player.name == "Tim Duncan" @@ -241,9 +241,9 @@ Feature: Delete int vid of tag """ FETCH PROP ON team hash("Spurs") YIELD team.name """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | team.name | - | "Spurs" | "Spurs" | + Then the result should be, in any order: + | team.name | + | "Spurs" | # delete one tag When executing query: """ @@ -256,7 +256,7 @@ Feature: Delete int vid of tag FETCH PROP ON team hash("Spurs") YIELD team.name """ Then the result should be, in any order: - | VertexID | team.name | + | team.name | # delete tag from pipe and normal When executing query: """ @@ -280,9 +280,9 @@ Feature: Delete int vid of tag """ FETCH PROP ON team hash("Spurs") YIELD team.name """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | team.name | - | "Spurs" | "Spurs" | + Then the result should be, in any order: + | team.name | + | "Spurs" | # delete one tag When executing query: """ @@ -295,7 +295,7 @@ Feature: Delete int vid of tag FETCH PROP ON team hash("Spurs") YIELD team.name """ Then the result should be, in any order: - | VertexID | team.name | + | team.name | # delete one tag from var and normal When executing query: """ diff --git a/tests/tck/features/delete/DeleteTag.feature b/tests/tck/features/delete/DeleteTag.feature index e73b5ae62a2..13757ba65bc 100644 --- a/tests/tck/features/delete/DeleteTag.feature +++ b/tests/tck/features/delete/DeleteTag.feature @@ -13,15 +13,15 @@ Feature: Delete string vid of tag FETCH PROP ON player "Tim Duncan" YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | - | "Tim Duncan" | "Tim Duncan" | 42 | + | player.name | player.age | + | "Tim Duncan" | 42 | When executing query: """ FETCH PROP ON bachelor "Tim Duncan" YIELD bachelor.name, bachelor.speciality """ Then the result should be, in any order: - | VertexID | bachelor.name | bachelor.speciality | - | "Tim Duncan" | "Tim Duncan" | "psychology" | + | bachelor.name | bachelor.speciality | + | "Tim Duncan" | "psychology" | When executing query: """ LOOKUP ON player WHERE player.name == "Tim Duncan" @@ -41,14 +41,14 @@ Feature: Delete string vid of tag FETCH PROP ON player "Tim Duncan" YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | + | player.name | player.age | When executing query: """ FETCH PROP ON bachelor "Tim Duncan" YIELD bachelor.name, bachelor.speciality """ Then the result should be, in any order: - | VertexID | bachelor.name | bachelor.speciality | - | "Tim Duncan" | "Tim Duncan" | "psychology" | + | bachelor.name | bachelor.speciality | + | "Tim Duncan" | "psychology" | When executing query: """ LOOKUP ON player WHERE player.name == "Tim Duncan" @@ -66,15 +66,15 @@ Feature: Delete string vid of tag FETCH PROP ON player "Tim Duncan" YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | - | "Tim Duncan" | "Tim Duncan" | 42 | + | player.name | player.age | + | "Tim Duncan" | 42 | When executing query: """ FETCH PROP ON bachelor "Tim Duncan" YIELD bachelor.name, bachelor.speciality """ Then the result should be, in any order: - | VertexID | bachelor.name | bachelor.speciality | - | "Tim Duncan" | "Tim Duncan" | "psychology" | + | bachelor.name | bachelor.speciality | + | "Tim Duncan" | "psychology" | When executing query: """ LOOKUP ON player WHERE player.name == "Tim Duncan" @@ -94,13 +94,13 @@ Feature: Delete string vid of tag FETCH PROP ON player "Tim Duncan" YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | + | player.name | player.age | When executing query: """ FETCH PROP ON bachelor "Tim Duncan" YIELD bachelor.name, bachelor.speciality """ Then the result should be, in any order: - | VertexID | bachelor.name | bachelor.speciality | + | bachelor.name | bachelor.speciality | When executing query: """ LOOKUP ON player WHERE player.name == "Tim Duncan" @@ -118,15 +118,15 @@ Feature: Delete string vid of tag FETCH PROP ON player "Tim Duncan" YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | - | "Tim Duncan" | "Tim Duncan" | 42 | + | player.name | player.age | + | "Tim Duncan" | 42 | When executing query: """ FETCH PROP ON bachelor "Tim Duncan" YIELD bachelor.name, bachelor.speciality """ Then the result should be, in any order: - | VertexID | bachelor.name | bachelor.speciality | - | "Tim Duncan" | "Tim Duncan" | "psychology" | + | bachelor.name | bachelor.speciality | + | "Tim Duncan" | "psychology" | When executing query: """ LOOKUP ON player WHERE player.name == "Tim Duncan" @@ -146,13 +146,13 @@ Feature: Delete string vid of tag FETCH PROP ON player "Tim Duncan" YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | + | player.name | player.age | When executing query: """ FETCH PROP ON bachelor "Tim Duncan" YIELD bachelor.name, bachelor.speciality """ Then the result should be, in any order: - | VertexID | bachelor.name | bachelor.speciality | + | bachelor.name | bachelor.speciality | When executing query: """ LOOKUP ON player WHERE player.name == "Tim Duncan" @@ -170,15 +170,15 @@ Feature: Delete string vid of tag FETCH PROP ON player "Tim Duncan" YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | - | "Tim Duncan" | "Tim Duncan" | 42 | + | player.name | player.age | + | "Tim Duncan" | 42 | When executing query: """ FETCH PROP ON player "Tony Parker" YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | - | "Tony Parker" | "Tony Parker" | 36 | + | player.name | player.age | + | "Tony Parker" | 36 | When executing query: """ LOOKUP ON player WHERE player.name == "Tim Duncan" @@ -205,13 +205,13 @@ Feature: Delete string vid of tag FETCH PROP ON player "Tim Duncan" YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | + | player.name | player.age | When executing query: """ FETCH PROP ON player "Tony Parker" YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | + | player.name | player.age | When executing query: """ LOOKUP ON player WHERE player.name == "Tim Duncan" @@ -242,8 +242,8 @@ Feature: Delete string vid of tag FETCH PROP ON team "Spurs" YIELD team.name """ Then the result should be, in any order: - | VertexID | team.name | - | "Spurs" | "Spurs" | + | team.name | + | "Spurs" | # delete one tag When executing query: """ @@ -256,7 +256,7 @@ Feature: Delete string vid of tag FETCH PROP ON team "Spurs" YIELD team.name """ Then the result should be, in any order: - | VertexID | team.name | + | team.name | # delete tag from pipe and normal When executing query: """ @@ -281,8 +281,8 @@ Feature: Delete string vid of tag FETCH PROP ON team "Spurs" YIELD team.name """ Then the result should be, in any order: - | VertexID | team.name | - | "Spurs" | "Spurs" | + | team.name | + | "Spurs" | # delete one tag When executing query: """ @@ -295,7 +295,7 @@ Feature: Delete string vid of tag FETCH PROP ON team "Spurs" YIELD team.name """ Then the result should be, in any order: - | VertexID | team.name | + | team.name | # delete one tag from var and normal When executing query: """ diff --git a/tests/tck/features/delete/DeleteVertex.IntVid.feature b/tests/tck/features/delete/DeleteVertex.IntVid.feature index 0771b4bf70b..8b43740c5e4 100644 --- a/tests/tck/features/delete/DeleteVertex.IntVid.feature +++ b/tests/tck/features/delete/DeleteVertex.IntVid.feature @@ -9,7 +9,7 @@ Feature: Delete int vid of vertex # get vertex info When executing query: """ - GO FROM hash("Boris Diaw") OVER like + GO FROM hash("Boris Diaw") OVER like YIELD like._dst """ Then the result should be, in any order, and the columns 0 should be hashed: | like._dst | @@ -17,7 +17,7 @@ Feature: Delete int vid of vertex | "Tim Duncan" | When executing query: """ - GO FROM hash("Tony Parker") OVER like REVERSELY + GO FROM hash("Tony Parker") OVER like REVERSELY YIELD like._dst """ Then the result should be, in any order, and the columns 0 should be hashed: | like._dst | @@ -31,17 +31,17 @@ Feature: Delete int vid of vertex """ FETCH PROP ON player hash("Tony Parker") YIELD player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | - | "Tony Parker" | "Tony Parker" | 36 | + Then the result should be, in any order: + | player.name | player.age | + | "Tony Parker" | 36 | # check value by fetch When executing query: """ FETCH PROP ON serve hash("Tony Parker")->hash("Spurs") YIELD serve.start_year, serve.end_year """ - Then the result should be, in any order, and the columns 0,1 should be hashed: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | 'Tony Parker' | 'Spurs' | 0 | 1999 | 2018 | + Then the result should be, in any order: + | serve.start_year | serve.end_year | + | 1999 | 2018 | # delete one vertex When executing query: """ @@ -54,18 +54,18 @@ Feature: Delete int vid of vertex FETCH PROP ON player hash("Tony Parker") YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | + | player.name | player.age | # check value by fetch When executing query: """ FETCH PROP ON serve hash("Tony Parker")->hash("Spurs") YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | + | serve.start_year | serve.end_year | # after delete to check value by go When executing query: """ - GO FROM hash("Boris Diaw") OVER like + GO FROM hash("Boris Diaw") OVER like YIELD like._dst """ Then the result should be, in any order, and the columns 0 should be hashed: | like._dst | @@ -73,14 +73,14 @@ Feature: Delete int vid of vertex # after delete to check value by go When executing query: """ - GO FROM hash("Tony Parker") OVER like REVERSELY + GO FROM hash("Tony Parker") OVER like REVERSELY YIELD like._dst """ Then the result should be, in any order: | like._dst | # before delete multi vertexes to check value by go When executing query: """ - GO FROM hash("Chris Paul") OVER like + GO FROM hash("Chris Paul") OVER like YIELD like._dst """ Then the result should be, in any order, and the columns 0 should be hashed: | like._dst | @@ -99,11 +99,11 @@ Feature: Delete int vid of vertex FETCH PROP ON player hash("Tony Parker") YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | + | player.name | player.age | # before delete hash id vertex to check value by go When executing query: """ - GO FROM hash("Tracy McGrady") OVER like + GO FROM hash("Tracy McGrady") OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -113,7 +113,7 @@ Feature: Delete int vid of vertex # before delete hash id vertex to check value by go When executing query: """ - GO FROM hash("Grant Hill") OVER like REVERSELY + GO FROM hash("Grant Hill") OVER like REVERSELY YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -124,16 +124,16 @@ Feature: Delete int vid of vertex FETCH PROP ON player hash("Grant Hill") YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | - | 6293765385213992205 | "Grant Hill" | 46 | + | player.name | player.age | + | "Grant Hill" | 46 | # before delete hash id vertex to check value by fetch When executing query: """ FETCH PROP ON serve hash("Grant Hill")->hash("Pistons") YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | 6293765385213992205 | -2742277443392542725 | 0 | 1994 | 2000 | + | serve.start_year | serve.end_year | + | 1994 | 2000 | # delete hash id vertex When executing query: """ @@ -143,7 +143,7 @@ Feature: Delete int vid of vertex # after delete hash id vertex to check value by go When executing query: """ - GO FROM hash("Tracy McGrady") OVER like + GO FROM hash("Tracy McGrady") OVER like YIELD like._dst """ Then the result should be, in any order, and the columns 0 should be hashed: | like._dst | @@ -152,7 +152,7 @@ Feature: Delete int vid of vertex # after delete hash id vertex to check value by go When executing query: """ - GO FROM hash("Grant Hill") OVER like REVERSELY + GO FROM hash("Grant Hill") OVER like REVERSELY YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -162,7 +162,7 @@ Feature: Delete int vid of vertex FETCH PROP ON player hash("Grant Hill") YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | + | player.name | player.age | # delete not existed vertex When executing query: """ @@ -182,7 +182,7 @@ Feature: Delete int vid of vertex FETCH PROP ON player hash("A Loner") YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | + | player.name | player.age | # delete with no edge When executing query: """ @@ -195,7 +195,7 @@ Feature: Delete int vid of vertex FETCH PROP ON player hash("Nobody") YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | + | player.name | player.age | Scenario: delete int vertex by pipe successed Given load "nba_int_vid" csv data to a new space @@ -208,7 +208,7 @@ Feature: Delete int vid of vertex # delete with pipe, get result by go When executing query: """ - GO FROM hash("Boris Diaw") OVER like + GO FROM hash("Boris Diaw") OVER like YIELD like._dst """ Then the result should be, in any order, and the columns 0 should be hashed: | like._dst | @@ -216,7 +216,7 @@ Feature: Delete int vid of vertex | "Tim Duncan" | When executing query: """ - GO FROM hash("Tony Parker") OVER like + GO FROM hash("Tony Parker") OVER like YIELD like._dst """ Then the result should be, in any order, and the columns 0 should be hashed: | like._dst | @@ -225,7 +225,7 @@ Feature: Delete int vid of vertex | "Tim Duncan" | When executing query: """ - GO FROM hash("Tim Duncan") OVER like + GO FROM hash("Tim Duncan") OVER like YIELD like._dst """ Then the result should be, in any order, and the columns 0 should be hashed: | like._dst | @@ -238,19 +238,19 @@ Feature: Delete int vid of vertex Then the execution should be successful When executing query: """ - GO FROM hash("Boris Diaw") OVER like + GO FROM hash("Boris Diaw") OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | When executing query: """ - GO FROM hash("Tony Parker") OVER like + GO FROM hash("Tony Parker") OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | When executing query: """ - GO FROM hash("Tim Duncan") OVER like + GO FROM hash("Tim Duncan") OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -267,7 +267,7 @@ Feature: Delete int vid of vertex Given load "nba_int_vid" csv data to a new space When executing query: """ - GO FROM hash("Russell Westbrook") OVER like + GO FROM hash("Russell Westbrook") OVER like YIELD like._dst """ Then the result should be, in any order, and the columns 0 should be hashed: | like._dst | @@ -275,14 +275,14 @@ Feature: Delete int vid of vertex | "James Harden" | When executing query: """ - GO FROM hash("Paul George") OVER like + GO FROM hash("Paul George") OVER like YIELD like._dst """ Then the result should be, in any order, and the columns 0 should be hashed: | like._dst | | "Russell Westbrook" | When executing query: """ - GO FROM hash("James Harden") OVER like + GO FROM hash("James Harden") OVER like YIELD like._dst """ Then the result should be, in any order, and the columns 0 should be hashed: | like._dst | @@ -294,19 +294,19 @@ Feature: Delete int vid of vertex Then the execution should be successful When executing query: """ - GO FROM hash("Russell Westbrook") OVER like + GO FROM hash("Russell Westbrook") OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | When executing query: """ - GO FROM hash("Paul George") OVER like + GO FROM hash("Paul George") OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | When executing query: """ - GO FROM hash("Russell Westbrook") OVER like + GO FROM hash("Russell Westbrook") OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | diff --git a/tests/tck/features/delete/DeleteVertex.feature b/tests/tck/features/delete/DeleteVertex.feature index 7622c5d30f7..ecbb325c398 100644 --- a/tests/tck/features/delete/DeleteVertex.feature +++ b/tests/tck/features/delete/DeleteVertex.feature @@ -9,7 +9,7 @@ Feature: Delete string vid of vertex # get vertex info When executing query: """ - GO FROM "Boris Diaw" OVER like + GO FROM "Boris Diaw" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -17,7 +17,7 @@ Feature: Delete string vid of vertex | "Tim Duncan" | When executing query: """ - GO FROM "Tony Parker" OVER like REVERSELY + GO FROM "Tony Parker" OVER like REVERSELY YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -32,16 +32,16 @@ Feature: Delete string vid of vertex FETCH PROP ON player "Tony Parker" YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | - | "Tony Parker" | "Tony Parker" | 36 | + | player.name | player.age | + | "Tony Parker" | 36 | # check value by fetch When executing query: """ FETCH PROP ON serve "Tony Parker"->"Spurs" YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Tony Parker" | "Spurs" | 0 | 1999 | 2018 | + | serve.start_year | serve.end_year | + | 1999 | 2018 | # delete one vertex When executing query: """ @@ -54,18 +54,18 @@ Feature: Delete string vid of vertex FETCH PROP ON player "Tony Parker" YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | + | player.name | player.age | # check value by fetch When executing query: """ FETCH PROP ON serve "Tony Parker"->"Spurs" YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | + | serve.start_year | serve.end_year | # after delete to check value by go When executing query: """ - GO FROM "Boris Diaw" OVER like + GO FROM "Boris Diaw" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -73,14 +73,14 @@ Feature: Delete string vid of vertex # after delete to check value by go When executing query: """ - GO FROM "Tony Parker" OVER like REVERSELY + GO FROM "Tony Parker" OVER like REVERSELY YIELD like._dst """ Then the result should be, in any order: | like._dst | # before delete multi vertexes to check value by go When executing query: """ - GO FROM "Chris Paul" OVER like + GO FROM "Chris Paul" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -99,11 +99,11 @@ Feature: Delete string vid of vertex FETCH PROP ON player "Tony Parker" YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | + | player.name | player.age | # before delete hash id vertex to check value by go When executing query: """ - GO FROM "Tracy McGrady" OVER like + GO FROM "Tracy McGrady" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -113,7 +113,7 @@ Feature: Delete string vid of vertex # before delete hash id vertex to check value by go When executing query: """ - GO FROM "Grant Hill" OVER like REVERSELY + GO FROM "Grant Hill" OVER like REVERSELY YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -124,16 +124,16 @@ Feature: Delete string vid of vertex FETCH PROP ON player "Grant Hill" YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | - | "Grant Hill" | "Grant Hill" | 46 | + | player.name | player.age | + | "Grant Hill" | 46 | # before delete hash id vertex to check value by fetch When executing query: """ FETCH PROP ON serve "Grant Hill"->"Pistons" YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Grant Hill" | "Pistons" | 0 | 1994 | 2000 | + | serve.start_year | serve.end_year | + | 1994 | 2000 | # delete hash id vertex When executing query: """ @@ -143,7 +143,7 @@ Feature: Delete string vid of vertex # after delete hash id vertex to check value by go When executing query: """ - GO FROM "Tracy McGrady" OVER like + GO FROM "Tracy McGrady" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -152,7 +152,7 @@ Feature: Delete string vid of vertex # after delete hash id vertex to check value by go When executing query: """ - GO FROM "Grant Hill" OVER like REVERSELY + GO FROM "Grant Hill" OVER like REVERSELY YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -162,7 +162,7 @@ Feature: Delete string vid of vertex FETCH PROP ON player "Grant Hill" YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | + | player.name | player.age | # delete not existed vertex When executing query: """ @@ -182,7 +182,7 @@ Feature: Delete string vid of vertex FETCH PROP ON player "A Loner" YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | + | player.name | player.age | # delete with no edge When executing query: """ @@ -195,7 +195,7 @@ Feature: Delete string vid of vertex FETCH PROP ON player "Nobody" YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | + | player.name | player.age | Then drop the used space Scenario: delete string vertex by pipe @@ -209,7 +209,7 @@ Feature: Delete string vid of vertex # delete with pipe, get result by go When executing query: """ - GO FROM "Boris Diaw" OVER like + GO FROM "Boris Diaw" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -217,7 +217,7 @@ Feature: Delete string vid of vertex | "Tim Duncan" | When executing query: """ - GO FROM "Tony Parker" OVER like + GO FROM "Tony Parker" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -226,7 +226,7 @@ Feature: Delete string vid of vertex | "Tim Duncan" | When executing query: """ - GO FROM "Tim Duncan" OVER like + GO FROM "Tim Duncan" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -239,19 +239,19 @@ Feature: Delete string vid of vertex Then the execution should be successful When executing query: """ - GO FROM "Boris Diaw" OVER like + GO FROM "Boris Diaw" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | When executing query: """ - GO FROM "Tony Parker" OVER like + GO FROM "Tony Parker" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | When executing query: """ - GO FROM "Tim Duncan" OVER like + GO FROM "Tim Duncan" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -260,7 +260,7 @@ Feature: Delete string vid of vertex Given load "nba" csv data to a new space When executing query: """ - GO FROM "Russell Westbrook" OVER like + GO FROM "Russell Westbrook" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -268,14 +268,14 @@ Feature: Delete string vid of vertex | "James Harden" | When executing query: """ - GO FROM "Paul George" OVER like + GO FROM "Paul George" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | | "Russell Westbrook" | When executing query: """ - GO FROM "James Harden" OVER like + GO FROM "James Harden" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -287,19 +287,19 @@ Feature: Delete string vid of vertex Then the execution should be successful When executing query: """ - GO FROM "Russell Westbrook" OVER like + GO FROM "Russell Westbrook" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | When executing query: """ - GO FROM "Paul George" OVER like + GO FROM "Paul George" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | When executing query: """ - GO FROM "Russell Westbrook" OVER like + GO FROM "Russell Westbrook" OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | diff --git a/tests/tck/features/expression/Case.feature b/tests/tck/features/expression/Case.feature index 28b5f51116c..f43fae6108d 100644 --- a/tests/tck/features/expression/Case.feature +++ b/tests/tck/features/expression/Case.feature @@ -299,7 +299,7 @@ Feature: Case Expression Scenario: Using the return value of case expr as an input When executing query: """ - RETURN CASE WHEN true THEN "Tim Duncan" ELSE "ABC" END AS a | GO FROM $-.a OVER like; + RETURN CASE WHEN true THEN "Tim Duncan" ELSE "ABC" END AS a | GO FROM $-.a OVER like YIELD like._dst; """ Then the result should be, in order: | like._dst | diff --git a/tests/tck/features/expression/In.feature b/tests/tck/features/expression/In.feature index b82b8ea2c55..c095eea9f4e 100644 --- a/tests/tck/features/expression/In.feature +++ b/tests/tck/features/expression/In.feature @@ -81,6 +81,7 @@ Feature: In Expression """ GO FROM 'Tony Parker' OVER like WHERE like._dst IN ['Danny Green'] + YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -88,6 +89,7 @@ Feature: In Expression """ GO FROM 'Tony Parker' OVER like WHERE like.likeness IN [95,56,21] + YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -96,7 +98,7 @@ Feature: In Expression When executing query: """ GO FROM 'Tony Parker' OVER like YIELD like._dst AS ID | - GO FROM $-.ID OVER like WHERE like.likeness IN [95,56,21] + GO FROM $-.ID OVER like WHERE like.likeness IN [95,56,21] YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -117,7 +119,7 @@ Feature: In Expression When executing query: """ GO FROM 'Tony Parker' OVER like - WHERE like._dst IN {'Danny Green'} + WHERE like._dst IN {'Danny Green'} YIELD like._dst """ Then the result should be, in any order: | like._dst | diff --git a/tests/tck/features/expression/NotIn.feature b/tests/tck/features/expression/NotIn.feature index 953f1ea3bde..e996192dbd0 100644 --- a/tests/tck/features/expression/NotIn.feature +++ b/tests/tck/features/expression/NotIn.feature @@ -69,6 +69,7 @@ Feature: Not In Expression """ GO FROM 'Tony Parker' OVER like WHERE like._dst NOT IN ['Danny Green'] + YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -113,6 +114,7 @@ Feature: Not In Expression """ GO FROM 'Tony Parker' OVER like WHERE like._dst NOT IN {'Danny Green'} + YIELD like._dst """ Then the result should be, in any order: | like._dst | diff --git a/tests/tck/features/fetch/FetchEdges.intVid.feature b/tests/tck/features/fetch/FetchEdges.intVid.feature index e4b6723291c..469bd5ebf30 100644 --- a/tests/tck/features/fetch/FetchEdges.intVid.feature +++ b/tests/tck/features/fetch/FetchEdges.intVid.feature @@ -9,45 +9,45 @@ Feature: Fetch Int Vid Edges """ FETCH PROP ON serve hash('Boris Diaw') -> hash('Hawks') YIELD serve.start_year, serve.end_year """ - Then the result should be, in any order, and the columns 0,1 should be hashed: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | + Then the result should be, in any order: + | serve.start_year | serve.end_year | + | 2003 | 2005 | When executing query: """ FETCH PROP ON serve hash('Boris Diaw')->hash('Hawks') YIELD serve.start_year > 2001, serve.end_year """ - Then the result should be, in any order, and the columns 0,1 should be hashed: - | serve._src | serve._dst | serve._rank | (serve.start_year>2001) | serve.end_year | - | "Boris Diaw" | "Hawks" | 0 | True | 2005 | + Then the result should be, in any order: + | (serve.start_year>2001) | serve.end_year | + | True | 2005 | # Fetch prop on an edge without yield When executing query: """ - FETCH PROP ON serve hash("Boris Diaw")->hash("Spurs") + FETCH PROP ON serve hash("Boris Diaw")->hash("Spurs") YIELD edge as e """ Then the result should be, in any order: - | edges_ | + | e | | [:serve hash("Boris Diaw")->hash("Spurs") @0 {end_year: 2016, start_year: 2012}] | When executing query: """ - FETCH PROP ON serve hash("Boris Diaw")->hash("Not Exist") + FETCH PROP ON serve hash("Boris Diaw")->hash("Not Exist") YIELD edge as e """ Then the result should be, in any order: - | edges_ | + | e | # Fetch prop on the edgetype of a edge with ranking When executing query: """ FETCH PROP ON serve hash('Boris Diaw')->hash('Hawks')@0 YIELD serve.start_year, serve.end_year """ - Then the result should be, in any order, and the columns 0,1 should be hashed: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | + Then the result should be, in any order: + | serve.start_year | serve.end_year | + | 2003 | 2005 | # Fetch prop on a edge with a rank,but without yield When executing query: """ - FETCH PROP ON like hash("Tony Parker")->hash("Tim Duncan")@0 + FETCH PROP ON like hash("Tony Parker")->hash("Tim Duncan")@0 YIELD edge as e """ Then the result should be, in any order: - | edges_ | + | e | | [:like hash("Tony Parker")->hash("Tim Duncan") @0 {likeness: 95}] | Scenario: Fetch prop on multiple edges @@ -55,18 +55,18 @@ Feature: Fetch Int Vid Edges """ FETCH PROP ON serve hash('Boris Diaw')->hash('Hawks'),hash('Boris Diaw')->hash('Suns') YIELD serve.start_year, serve.end_year """ - Then the result should be, in any order, and the columns 0,1 should be hashed: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | - | "Boris Diaw" | "Suns" | 0 | 2005 | 2008 | + Then the result should be, in any order: + | serve.start_year | serve.end_year | + | 2003 | 2005 | + | 2005 | 2008 | # fetch prop on exist and not exist edges When executing query: """ FETCH PROP ON serve hash("Zion Williamson")->hash("Spurs"), hash("Boris Diaw")->hash("Hawks") YIELD serve.start_year """ - Then the result should be, in any order, and the columns 0,1 should be hashed: - | serve._src | serve._dst | serve._rank | serve.start_year | - | "Boris Diaw" | "Hawks" | 0 | 2003 | + Then the result should be, in any order: + | serve.start_year | + | 2003 | Scenario: Fetch prop works with pipeline When executing query: @@ -74,13 +74,13 @@ Feature: Fetch Int Vid Edges GO FROM hash('Boris Diaw') OVER serve YIELD serve._src AS src, serve._dst AS dst | FETCH PROP ON serve $-.src->$-.dst YIELD serve.start_year, serve.end_year """ - Then the result should be, in any order, and the columns 0,1 should be hashed: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Suns" | 0 | 2005 | 2008 | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | - | "Boris Diaw" | "Spurs" | 0 | 2012 | 2016 | - | "Boris Diaw" | "Hornets" | 0 | 2008 | 2012 | - | "Boris Diaw" | "Jazz" | 0 | 2016 | 2017 | + Then the result should be, in any order: + | serve.start_year | serve.end_year | + | 2005 | 2008 | + | 2003 | 2005 | + | 2012 | 2016 | + | 2008 | 2012 | + | 2016 | 2017 | Scenario: Fetch prop works with user define variable When executing query: @@ -88,13 +88,13 @@ Feature: Fetch Int Vid Edges $var = GO FROM hash('Boris Diaw') OVER serve YIELD serve._src AS src, serve._dst AS dst; FETCH PROP ON serve $var.src->$var.dst YIELD serve.start_year, serve.end_year """ - Then the result should be, in any order, and the columns 0,1 should be hashed: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Suns" | 0 | 2005 | 2008 | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | - | "Boris Diaw" | "Spurs" | 0 | 2012 | 2016 | - | "Boris Diaw" | "Hornets" | 0 | 2008 | 2012 | - | "Boris Diaw" | "Jazz" | 0 | 2016 | 2017 | + Then the result should be, in any order: + | serve.start_year | serve.end_year | + | 2005 | 2008 | + | 2003 | 2005 | + | 2012 | 2016 | + | 2008 | 2012 | + | 2016 | 2017 | @skip Scenario: Fetch prop works with uuid @@ -103,68 +103,67 @@ Feature: Fetch Int Vid Edges FETCH PROP ON serve uuid('Boris Diaw')->uuid('Hawks') YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | -7391649757168799460 | 3973677956883673372 | 0 | 2003 | 2005 | + | serve.start_year | serve.end_year | + | 2003 | 2005 | # Fetch prop works with uuid, but without YIELD When executing query: """ FETCH PROP ON serve uuid('Boris Diaw')->uuid('Hawks') YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | -7391649757168799460 | 3973677956883673372 | 0 | 2003 | 2005 | + | serve.start_year | serve.end_year | + | 2003 | 2005 | # Fetch prop works with not existing edge When executing query: """ FETCH PROP ON serve uuid("Zion Williamson")->uuid("Spurs") YIELD serve.start_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | + | serve.start_year | Scenario: Fetch prop works with DISTINCT When executing query: """ FETCH PROP ON serve hash('Boris Diaw')->hash('Hawks'),hash('Boris Diaw')->hash('Hawks') YIELD DISTINCT serve.start_year, serve.end_year """ - Then the result should be, in any order, and the columns 0,1 should be hashed: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | + Then the result should be, in any order: + | serve.start_year | serve.end_year | + | 2003 | 2005 | # Fetch prop works with DISTINCT and pipeline When executing query: """ GO FROM hash('Boris Diaw'),hash('Boris Diaw') OVER serve YIELD serve._src AS src, serve._dst AS dst | FETCH PROP ON serve $-.src->$-.dst YIELD DISTINCT serve.start_year, serve.end_year """ - Then the result should be, in any order, and the columns 0,1 should be hashed: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Suns" | 0 | 2005 | 2008 | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | - | "Boris Diaw" | "Spurs" | 0 | 2012 | 2016 | - | "Boris Diaw" | "Hornets" | 0 | 2008 | 2012 | - | "Boris Diaw" | "Jazz" | 0 | 2016 | 2017 | + Then the result should be, in any order: + | serve.start_year | serve.end_year | + | 2005 | 2008 | + | 2003 | 2005 | + | 2012 | 2016 | + | 2008 | 2012 | + | 2016 | 2017 | When executing query: """ GO FROM hash('Tim Duncan'),hash('Tony Parker') OVER serve YIELD serve._src AS src, serve._dst AS dst | FETCH PROP ON serve $-.src->$-.dst YIELD DISTINCT serve._dst as dst """ - Then the result should be, in any order, and the columns 0,1,3 should be hashed: - | serve._src | serve._dst | serve._rank | dst | - | 'Tim Duncan' | 'Spurs' | 0 | 'Spurs' | - | 'Tony Parker' | 'Spurs' | 0 | 'Spurs' | - | 'Tony Parker' | 'Hornets' | 0 | 'Hornets' | + Then the result should be, in any order, and the columns 0 should be hashed: + | dst | + | 'Spurs' | + | 'Hornets' | # Fetch prop works with DISTINCT and user define variable When executing query: """ $var = GO FROM hash('Boris Diaw'),hash('Boris Diaw') OVER serve YIELD serve._src AS src, serve._dst AS dst; FETCH PROP ON serve $var.src->$var.dst YIELD DISTINCT serve.start_year, serve.end_year """ - Then the result should be, in any order, and the columns 0,1 should be hashed: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Suns" | 0 | 2005 | 2008 | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | - | "Boris Diaw" | "Spurs" | 0 | 2012 | 2016 | - | "Boris Diaw" | "Hornets" | 0 | 2008 | 2012 | - | "Boris Diaw" | "Jazz" | 0 | 2016 | 2017 | + Then the result should be, in any order, with relax comparison: + | serve.start_year | serve.end_year | + | 2005 | 2008 | + | 2003 | 2005 | + | 2012 | 2016 | + | 2008 | 2012 | + | 2016 | 2017 | Scenario: Fetch prop on not existing edge # Fetch prop on not exist edge @@ -173,14 +172,14 @@ Feature: Fetch Int Vid Edges FETCH PROP ON serve hash("Zion Williamson")->hash("Spurs") YIELD serve.start_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | + | serve.start_year | When executing query: """ GO FROM hash("NON EXIST VERTEX ID") OVER serve YIELD serve._src AS src, serve._dst AS dst | FETCH PROP ON serve $-.src->$-.dst YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | + | serve.start_year | serve.end_year | When executing query: """ GO FROM hash("NON EXIST VERTEX ID") OVER serve YIELD serve._src AS src, serve._dst AS dst, serve.start_year as start | @@ -188,7 +187,7 @@ Feature: Fetch Int Vid Edges FETCH PROP ON serve $-.src->$-.dst YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | + | serve.start_year | serve.end_year | When executing query: """ GO FROM hash("Marco Belinelli") OVER serve YIELD serve._src AS src, serve._dst AS dst, serve.start_year as start | @@ -196,7 +195,7 @@ Feature: Fetch Int Vid Edges FETCH PROP ON serve $-.src->$-.dst YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | + | serve.start_year | serve.end_year | Scenario: Fetch prop Error When executing query: @@ -234,46 +233,46 @@ Feature: Fetch Int Vid Edges """ FETCH PROP ON serve hash('Boris Diaw')->hash("Spurs") YIELD serve.start_year, serve.start_year """ - Then the result should be, in any order, and the columns 0,1 should be hashed: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.start_year | - | "Boris Diaw" | "Spurs" | 0 | 2012 | 2012 | + Then the result should be, in any order: + | serve.start_year | serve.start_year | + | 2012 | 2012 | Scenario: Fetch prop on an edge and return duplicate _src, _dst and _rank When executing query: """ FETCH PROP ON serve hash('Boris Diaw')->hash("Spurs") YIELD serve._src, serve._dst, serve._rank """ - Then the result should be, in any order, and the columns 0,1,3,4 should be hashed: - | serve._src | serve._dst | serve._rank | serve._src | serve._dst | serve._rank | - | "Boris Diaw" | "Spurs" | 0 | "Boris Diaw" | "Spurs" | 0 | + Then the result should be, in any order, and the columns 0,1 should be hashed: + | serve._src | serve._dst | serve._rank | + | "Boris Diaw" | "Spurs" | 0 | Scenario: yield edge When executing query: """ FETCH PROP ON serve hash('Boris Diaw') -> hash('Hawks') YIELD serve.start_year, serve.end_year, edge as relationship """ - Then the result should be, in any order, and the columns 0, 1 should be hashed: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | relationship | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | [:serve hash("Boris Diaw")->hash("Hawks") @0 {end_year: 2005, start_year: 2003}] | + Then the result should be, in any order: + | serve.start_year | serve.end_year | relationship | + | 2003 | 2005 | [:serve hash("Boris Diaw")->hash("Hawks") @0 {end_year: 2005, start_year: 2003}] | When executing query: """ FETCH PROP ON serve hash("Boris Diaw")->hash("Spurs") YIELD edge as relationship, src(edge) as src_edge, dst(edge) as dst_edge, type(edge) as type, rank(edge) as rank """ - Then the result should be, in any order, and the columns 0, 1, 4, 5 should be hashed: - | serve._src | serve._dst | serve._rank | relationship | src_edge | dst_edge | type | rank | - | "Boris Diaw" | "Spurs" | 0 | [:serve hash("Boris Diaw")->hash("Spurs") @0 {end_year: 2016, start_year: 2012}] | "Boris Diaw" | "Spurs" | "serve" | 0 | + Then the result should be, in any order, and the columns 1,2 should be hashed: + | relationship | src_edge | dst_edge | type | rank | + | [:serve hash("Boris Diaw")->hash("Spurs") @0 {end_year: 2016, start_year: 2012}] | "Boris Diaw" | "Spurs" | "serve" | 0 | When executing query: """ FETCH PROP ON serve hash("Boris Diaw")->hash("Not Exist") YIELD src(edge) as a """ - Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | a | + Then the result should be, in any order, with relax comparison: + | a | When executing query: """ FETCH PROP ON like hash("Tony Parker")->hash("Tim Duncan"), hash("Grant Hill") -> hash("Tracy McGrady") YIELD edge as relationship | YIELD properties($-.relationship) """ - Then the result should be, in any order: + Then the result should be, in any order, with relax comparison: | properties($-.relationship) | | {likeness: 95} | | {likeness: 90} | @@ -281,10 +280,10 @@ Feature: Fetch Int Vid Edges """ FETCH PROP ON like hash("Tony Parker")->hash("Tim Duncan"), hash("Grant Hill") -> hash("Tracy McGrady") YIELD properties(edge) as properties """ - Then the result should be, in any order, and the columns 0, 1 should be hashed: - | like._src | like._dst | like._rank | properties | - | "Tony Parker" | "Tim Duncan" | 0 | {likeness: 95} | - | "Grant Hill" | "Tracy McGrady" | 0 | {likeness: 90} | + Then the result should be, in any order, with relax comparison: + | properties | + | {likeness: 95} | + | {likeness: 90} | When executing query: """ FETCH PROP ON like hash("Tony Parker")->hash("Tim Duncan"), hash("Grant Hill") -> hash("Tracy McGrady") YIELD edge as relationship | @@ -308,10 +307,10 @@ Feature: Fetch Int Vid Edges $var = GO FROM hash('Boris Diaw'),hash('Boris Diaw') OVER serve YIELD serve._src AS src, serve._dst AS dst; FETCH PROP ON serve $var.src->$var.dst YIELD DISTINCT serve.start_year, serve.end_year, edge as relationship """ - Then the result should be, in any order, and the columns 0, 1 should be hashed: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | relationship | - | "Boris Diaw" | "Suns" | 0 | 2005 | 2008 | [:serve hash("Boris Diaw")->hash("Suns") @0 {end_year: 2008, start_year: 2005}] | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | [:serve hash("Boris Diaw")->hash("Hawks") @0 {end_year: 2005, start_year: 2003}] | - | "Boris Diaw" | "Spurs" | 0 | 2012 | 2016 | [:serve hash("Boris Diaw")->hash("Spurs") @0 {end_year: 2016, start_year: 2012}] | - | "Boris Diaw" | "Hornets" | 0 | 2008 | 2012 | [:serve hash("Boris Diaw")->hash("Hornets") @0 {end_year: 2012, start_year: 2008}] | - | "Boris Diaw" | "Jazz" | 0 | 2016 | 2017 | [:serve hash("Boris Diaw")->hash("Jazz") @0 {end_year: 2017, start_year: 2016}] | + Then the result should be, in any order, with relax comparison: + | serve.start_year | serve.end_year | relationship | + | 2005 | 2008 | [:serve hash("Boris Diaw")->hash("Suns") @0 {end_year: 2008, start_year: 2005}] | + | 2003 | 2005 | [:serve hash("Boris Diaw")->hash("Hawks") @0 {end_year: 2005, start_year: 2003}] | + | 2012 | 2016 | [:serve hash("Boris Diaw")->hash("Spurs") @0 {end_year: 2016, start_year: 2012}] | + | 2008 | 2012 | [:serve hash("Boris Diaw")->hash("Hornets") @0 {end_year: 2012, start_year: 2008}] | + | 2016 | 2017 | [:serve hash("Boris Diaw")->hash("Jazz") @0 {end_year: 2017, start_year: 2016}] | diff --git a/tests/tck/features/fetch/FetchEdges.strVid.feature b/tests/tck/features/fetch/FetchEdges.strVid.feature index 6067ef44191..8a4d4b2c44d 100644 --- a/tests/tck/features/fetch/FetchEdges.strVid.feature +++ b/tests/tck/features/fetch/FetchEdges.strVid.feature @@ -9,21 +9,21 @@ Feature: Fetch String Vid Edges FETCH PROP ON serve 'Boris Diaw' -> 'Hawks' YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | + | serve.start_year | serve.end_year | + | 2003 | 2005 | When executing query: """ - FETCH PROP ON serve "Boris Diaw"->"Spurs" + FETCH PROP ON serve "Boris Diaw"->"Spurs" YIELD edge as e """ Then the result should be, in any order: - | edges_ | + | e | | [:serve "Boris Diaw"->"Spurs" @0 {end_year: 2016, start_year: 2012}] | When executing query: """ - FETCH PROP ON serve "Boris Diaw"->"Not Exist" + FETCH PROP ON serve "Boris Diaw"->"Not Exist" YIELD edge as e """ Then the result should be, in any order: - | edges_ | + | e | Scenario: Fetch prop on an edge When executing query: @@ -31,32 +31,32 @@ Feature: Fetch String Vid Edges FETCH PROP ON serve 'Boris Diaw'->'Hawks' YIELD serve.start_year > 2001, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | (serve.start_year>2001) | serve.end_year | - | "Boris Diaw" | "Hawks" | 0 | True | 2005 | + | (serve.start_year>2001) | serve.end_year | + | True | 2005 | # Fetch prop on the edgetype of a edge with ranking When executing query: """ FETCH PROP ON serve 'Boris Diaw'->'Hawks'@0 YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | + | serve.start_year | serve.end_year | + | 2003 | 2005 | # Fetch prop on an edge without yield When executing query: """ FETCH PROP ON serve 'Boris Diaw'->'Hawks' YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | + | serve.start_year | serve.end_year | + | 2003 | 2005 | # Fetch prop on a edge with a rank,but without yield When executing query: """ FETCH PROP ON serve 'Boris Diaw'->'Hawks'@0 YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | + | serve.start_year | serve.end_year | + | 2003 | 2005 | Scenario: Fetch prop on multiple edges When executing query: @@ -64,9 +64,9 @@ Feature: Fetch String Vid Edges FETCH PROP ON serve 'Boris Diaw'->'Hawks','Boris Diaw'->'Suns' YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | - | "Boris Diaw" | "Suns" | 0 | 2005 | 2008 | + | serve.start_year | serve.end_year | + | 2003 | 2005 | + | 2005 | 2008 | Scenario: Fetch prop works with pipeline When executing query: @@ -74,12 +74,12 @@ Feature: Fetch String Vid Edges GO FROM 'Boris Diaw' OVER serve YIELD serve._src AS src, serve._dst AS dst | FETCH PROP ON serve $-.src->$-.dst YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Suns" | 0 | 2005 | 2008 | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | - | "Boris Diaw" | "Spurs" | 0 | 2012 | 2016 | - | "Boris Diaw" | "Hornets" | 0 | 2008 | 2012 | - | "Boris Diaw" | "Jazz" | 0 | 2016 | 2017 | + | serve.start_year | serve.end_year | + | 2005 | 2008 | + | 2003 | 2005 | + | 2012 | 2016 | + | 2008 | 2012 | + | 2016 | 2017 | Scenario: Fetch prop works with user define variable When executing query: @@ -88,12 +88,12 @@ Feature: Fetch String Vid Edges FETCH PROP ON serve $var.src->$var.dst YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Suns" | 0 | 2005 | 2008 | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | - | "Boris Diaw" | "Spurs" | 0 | 2012 | 2016 | - | "Boris Diaw" | "Hornets" | 0 | 2008 | 2012 | - | "Boris Diaw" | "Jazz" | 0 | 2016 | 2017 | + | serve.start_year | serve.end_year | + | 2005 | 2008 | + | 2003 | 2005 | + | 2012 | 2016 | + | 2008 | 2012 | + | 2016 | 2017 | Scenario: Fetch prop works with DISTINCT When executing query: @@ -101,8 +101,8 @@ Feature: Fetch String Vid Edges FETCH PROP ON serve 'Boris Diaw'->'Hawks','Boris Diaw'->'Hawks' YIELD DISTINCT serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | + | serve.start_year | serve.end_year | + | 2003 | 2005 | # Fetch prop works with DISTINCT and pipeline When executing query: """ @@ -110,22 +110,21 @@ Feature: Fetch String Vid Edges FETCH PROP ON serve $-.src->$-.dst YIELD DISTINCT serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Suns" | 0 | 2005 | 2008 | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | - | "Boris Diaw" | "Spurs" | 0 | 2012 | 2016 | - | "Boris Diaw" | "Hornets" | 0 | 2008 | 2012 | - | "Boris Diaw" | "Jazz" | 0 | 2016 | 2017 | + | serve.start_year | serve.end_year | + | 2005 | 2008 | + | 2003 | 2005 | + | 2012 | 2016 | + | 2008 | 2012 | + | 2016 | 2017 | When executing query: """ GO FROM 'Tim Duncan','Tony Parker' OVER serve YIELD serve._src AS src, serve._dst AS dst | FETCH PROP ON serve $-.src->$-.dst YIELD DISTINCT serve._dst as dst """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | dst | - | 'Tim Duncan' | 'Spurs' | 0 | 'Spurs' | - | 'Tony Parker' | 'Spurs' | 0 | 'Spurs' | - | 'Tony Parker' | 'Hornets' | 0 | 'Hornets' | + | dst | + | 'Spurs' | + | 'Hornets' | # Fetch prop works with DISTINCT and user define variable When executing query: """ @@ -133,12 +132,12 @@ Feature: Fetch String Vid Edges FETCH PROP ON serve $var.src->$var.dst YIELD DISTINCT serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | - | "Boris Diaw" | "Suns" | 0 | 2005 | 2008 | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | - | "Boris Diaw" | "Spurs" | 0 | 2012 | 2016 | - | "Boris Diaw" | "Hornets" | 0 | 2008 | 2012 | - | "Boris Diaw" | "Jazz" | 0 | 2016 | 2017 | + | serve.start_year | serve.end_year | + | 2005 | 2008 | + | 2003 | 2005 | + | 2012 | 2016 | + | 2008 | 2012 | + | 2016 | 2017 | Scenario: Fetch prop on not existing vertex When executing query: @@ -146,14 +145,14 @@ Feature: Fetch String Vid Edges FETCH PROP ON serve "Zion Williamson"->"Spurs" YIELD serve.start_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | + | serve.start_year | When executing query: """ GO FROM "NON EXIST VERTEX ID" OVER serve YIELD serve._src AS src, serve._dst AS dst | FETCH PROP ON serve $-.src->$-.dst YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | + | serve.start_year | serve.end_year | When executing query: """ GO FROM "NON EXIST VERTEX ID" OVER serve YIELD serve._src AS src, serve._dst AS dst, serve.start_year as start | @@ -161,7 +160,7 @@ Feature: Fetch String Vid Edges FETCH PROP ON serve $-.src->$-.dst YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | + | serve.start_year | serve.end_year | When executing query: """ GO FROM "Marco Belinelli" OVER serve YIELD serve._src AS src, serve._dst AS dst, serve.start_year as start | @@ -169,7 +168,7 @@ Feature: Fetch String Vid Edges FETCH PROP ON serve $-.src->$-.dst YIELD serve.start_year, serve.end_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | + | serve.start_year | serve.end_year | Scenario: Fetch prop on exist and not exist edges When executing query: @@ -177,8 +176,8 @@ Feature: Fetch String Vid Edges FETCH PROP ON serve "Zion Williamson"->"Spurs", "Boris Diaw"->"Hawks" YIELD serve.start_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | - | "Boris Diaw" | "Hawks" | 0 | 2003 | + | serve.start_year | + | 2003 | Scenario: Fetch prop on a edge and return duplicate columns When executing query: @@ -186,8 +185,8 @@ Feature: Fetch String Vid Edges FETCH PROP ON serve "Boris Diaw"->"Spurs" YIELD serve.start_year, serve.start_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.start_year | - | "Boris Diaw" | "Spurs" | 0 | 2012 | 2012 | + | serve.start_year | serve.start_year | + | 2012 | 2012 | Scenario: Fetch prop on an edge and return duplicate _src, _dst and _rank When executing query: @@ -195,23 +194,23 @@ Feature: Fetch String Vid Edges FETCH PROP ON serve 'Boris Diaw'->"Spurs" YIELD serve._src, serve._dst, serve._rank """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve._src | serve._dst | serve._rank | - | "Boris Diaw" | "Spurs" | 0 | "Boris Diaw" | "Spurs" | 0 | + | serve._src | serve._dst | serve._rank | + | "Boris Diaw" | "Spurs" | 0 | Scenario: Fetch and Yield When executing query: """ - FETCH PROP ON like "Tony Parker"->"Tim Duncan", "Grant Hill" -> "Tracy McGrady" | - YIELD properties($-.edges_) + FETCH PROP ON like "Tony Parker"->"Tim Duncan", "Grant Hill" -> "Tracy McGrady" YIELD edge as e | + YIELD properties($-.e) """ Then the result should be, in any order: - | properties($-.edges_) | - | {likeness: 95} | - | {likeness: 90} | + | properties($-.e) | + | {likeness: 95} | + | {likeness: 90} | When executing query: """ - FETCH PROP ON like "Tony Parker"->"Tim Duncan", "Grant Hill" -> "Tracy McGrady" | - YIELD startNode($-.edges_) AS nodes + FETCH PROP ON like "Tony Parker"->"Tim Duncan", "Grant Hill" -> "Tracy McGrady" YIELD edge as e | + YIELD startNode($-.e) AS nodes """ Then the result should be, in any order, with relax comparison: | nodes | @@ -219,8 +218,8 @@ Feature: Fetch String Vid Edges | ("Grant Hill") | When executing query: """ - FETCH PROP ON like "Tony Parker"->"Tim Duncan", "Grant Hill" -> "Tracy McGrady" | - YIELD endNode($-.edges_) AS nodes + FETCH PROP ON like "Tony Parker"->"Tim Duncan", "Grant Hill" -> "Tracy McGrady" YIELD edge as e | + YIELD endNode($-.e) AS nodes """ Then the result should be, in any order, with relax comparison: | nodes | @@ -263,21 +262,21 @@ Feature: Fetch String Vid Edges FETCH PROP ON serve 'Boris Diaw' -> 'Hawks' YIELD serve.start_year, serve.end_year, edge as relationship """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | relationship | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | [:serve "Boris Diaw"->"Hawks" @0 {end_year: 2005, start_year: 2003}] | + | serve.start_year | serve.end_year | relationship | + | 2003 | 2005 | [:serve "Boris Diaw"->"Hawks" @0 {end_year: 2005, start_year: 2003}] | When executing query: """ FETCH PROP ON serve "Boris Diaw"->"Spurs" YIELD edge as relationship, src(edge) as src_edge, dst(edge) as dst_edge, type(edge) as type, rank(edge) as rank """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | relationship | src_edge | dst_edge | type | rank | - | "Boris Diaw" | "Spurs" | 0 | [:serve "Boris Diaw"->"Spurs" @0 {end_year: 2016, start_year: 2012}] | "Boris Diaw" | "Spurs" | "serve" | 0 | + | relationship | src_edge | dst_edge | type | rank | + | [:serve "Boris Diaw"->"Spurs" @0 {end_year: 2016, start_year: 2012}] | "Boris Diaw" | "Spurs" | "serve" | 0 | When executing query: """ FETCH PROP ON serve "Boris Diaw"->"Not Exist" YIELD src(edge) as a """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | a | + | a | When executing query: """ FETCH PROP ON like "Tony Parker"->"Tim Duncan", "Grant Hill" -> "Tracy McGrady" YIELD edge as relationship | @@ -292,9 +291,9 @@ Feature: Fetch String Vid Edges FETCH PROP ON like "Tony Parker"->"Tim Duncan", "Grant Hill" -> "Tracy McGrady" YIELD properties(edge) as properties """ Then the result should be, in any order: - | like._src | like._dst | like._rank | properties | - | "Tony Parker" | "Tim Duncan" | 0 | {likeness: 95} | - | "Grant Hill" | "Tracy McGrady" | 0 | {likeness: 90} | + | properties | + | {likeness: 95} | + | {likeness: 90} | When executing query: """ FETCH PROP ON like "Tony Parker"->"Tim Duncan", "Grant Hill" -> "Tracy McGrady" YIELD edge as relationship | @@ -319,9 +318,9 @@ Feature: Fetch String Vid Edges FETCH PROP ON serve $var.src->$var.dst YIELD DISTINCT serve.start_year, serve.end_year, edge as relationship """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | serve.end_year | relationship | - | "Boris Diaw" | "Suns" | 0 | 2005 | 2008 | [:serve "Boris Diaw"->"Suns" @0 {end_year: 2008, start_year: 2005}] | - | "Boris Diaw" | "Hawks" | 0 | 2003 | 2005 | [:serve "Boris Diaw"->"Hawks" @0 {end_year: 2005, start_year: 2003}] | - | "Boris Diaw" | "Spurs" | 0 | 2012 | 2016 | [:serve "Boris Diaw"->"Spurs" @0 {end_year: 2016, start_year: 2012}] | - | "Boris Diaw" | "Hornets" | 0 | 2008 | 2012 | [:serve "Boris Diaw"->"Hornets" @0 {end_year: 2012, start_year: 2008}] | - | "Boris Diaw" | "Jazz" | 0 | 2016 | 2017 | [:serve "Boris Diaw"->"Jazz" @0 {end_year: 2017, start_year: 2016}] | + | serve.start_year | serve.end_year | relationship | + | 2005 | 2008 | [:serve "Boris Diaw"->"Suns" @0 {end_year: 2008, start_year: 2005}] | + | 2003 | 2005 | [:serve "Boris Diaw"->"Hawks" @0 {end_year: 2005, start_year: 2003}] | + | 2012 | 2016 | [:serve "Boris Diaw"->"Spurs" @0 {end_year: 2016, start_year: 2012}] | + | 2008 | 2012 | [:serve "Boris Diaw"->"Hornets" @0 {end_year: 2012, start_year: 2008}] | + | 2016 | 2017 | [:serve "Boris Diaw"->"Jazz" @0 {end_year: 2017, start_year: 2016}] | diff --git a/tests/tck/features/fetch/FetchEmpty.feature b/tests/tck/features/fetch/FetchEmpty.feature index 3fd183e831b..7ecca54af75 100644 --- a/tests/tck/features/fetch/FetchEmpty.feature +++ b/tests/tck/features/fetch/FetchEmpty.feature @@ -27,57 +27,57 @@ Feature: Fetch prop on empty tag/edge Scenario: fetch prop on all tags When executing query: """ - FETCH PROP ON * '1' + FETCH PROP ON * '1' YIELD vertex as node """ Then the result should be, in any order, with relax comparison: - | vertices_ | + | node | | ("1":zero_prop_tag_0:zero_prop_tag_1:person) | And drop the used space Scenario: fetch prop on a empty tag When executing query: """ - FETCH PROP ON zero_prop_tag_0 '1' + FETCH PROP ON zero_prop_tag_0 '1' YIELD vertex as node """ Then the result should be, in any order, with relax comparison: - | vertices_ | + | node | | ("1":zero_prop_tag_0) | When executing query: """ GO FROM "1" OVER zero_prop_edge YIELD zero_prop_edge._dst as id | - FETCH PROP ON zero_prop_tag_0 $-.id + FETCH PROP ON zero_prop_tag_0 $-.id YIELD vertex as node """ Then the result should be, in any order, with relax comparison: - | vertices_ | + | node | | ("2":zero_prop_tag_0) | And drop the used space Scenario: fetch prop on empty edge When executing query: """ - FETCH PROP ON zero_prop_edge "1"->"2" + FETCH PROP ON zero_prop_edge "1"->"2" YIELD edge as e """ Then the result should be, in any order: - | edges_ | + | e | | [:zero_prop_edge "1"->"2" @0{}] | When executing query: """ - FETCH PROP ON zero_prop_edge "1"->"3" + FETCH PROP ON zero_prop_edge "1"->"3" YIELD edge as e """ Then the result should be, in any order: - | edges_ | + | e | When executing query: """ - FETCH PROP ON zero_prop_edge "101"->"102" + FETCH PROP ON zero_prop_edge "101"->"102" YIELD edge as e """ Then the result should be, in any order: - | edges_ | + | e | When executing query: """ GO FROM "1" OVER zero_prop_edge YIELD zero_prop_edge._src as src, zero_prop_edge._dst as dst | - FETCH PROP ON zero_prop_edge $-.src->$-.dst + FETCH PROP ON zero_prop_edge $-.src->$-.dst YIELD edge as e """ Then the result should be, in any order: - | edges_ | + | e | | [:zero_prop_edge "1"->"2" @0{}] | And drop the used space diff --git a/tests/tck/features/fetch/FetchVertices.intVid.feature b/tests/tck/features/fetch/FetchVertices.intVid.feature index cdbfe636d7a..8857a319102 100644 --- a/tests/tck/features/fetch/FetchVertices.intVid.feature +++ b/tests/tck/features/fetch/FetchVertices.intVid.feature @@ -9,23 +9,23 @@ Feature: Fetch Int Vid Vertices """ FETCH PROP ON player hash('Boris Diaw') YIELD player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | - | "Boris Diaw" | "Boris Diaw" | 36 | + Then the result should be, in any order: + | player.name | player.age | + | "Boris Diaw" | 36 | When executing query: """ FETCH PROP ON player hash('Boris Diaw') YIELD player.name, player.age, player.age > 30 """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | (player.age>30) | - | "Boris Diaw" | "Boris Diaw" | 36 | True | + Then the result should be, in any order: + | player.name | player.age | (player.age>30) | + | "Boris Diaw" | 36 | True | # without YIELD When executing query: """ - FETCH PROP ON player hash('Boris Diaw') + FETCH PROP ON player hash('Boris Diaw') YIELD vertex as node """ Then the result should be, in any order: - | vertices_ | + | node | | (hash('Boris Diaw'):player{age:36,name:"Boris Diaw"}) | # Fetch prop on not existing vertex When executing query: @@ -33,7 +33,7 @@ Feature: Fetch Int Vid Vertices FETCH PROP ON player hash('NON EXIST VERTEX ID') yield player.name """ Then the result should be, in any order: - | VertexID | player.name | + | player.name | # work with ORDER BY When executing query: """ @@ -41,65 +41,65 @@ Feature: Fetch Int Vid Vertices FETCH PROP ON player $var.id YIELD player.name as name, player.age | ORDER BY $-.name """ - Then the result should be, in order, and the columns 0 should be hashed: - | VertexID | name | player.age | - | "Tim Duncan" | "Tim Duncan" | 42 | - | "Tony Parker" | "Tony Parker" | 36 | + Then the result should be, in any order: + | name | player.age | + | "Tim Duncan" | 42 | + | "Tony Parker" | 36 | # works with DISTINCT When executing query: """ FETCH PROP ON player hash('Boris Diaw'), hash('Boris Diaw') YIELD DISTINCT player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | - | "Boris Diaw" | "Boris Diaw" | 36 | + Then the result should be, in any order: + | player.name | player.age | + | "Boris Diaw" | 36 | When executing query: """ FETCH PROP ON player hash('Boris Diaw'), hash('Boris Diaw') YIELD DISTINCT player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.age | - | "Boris Diaw" | 36 | + Then the result should be, in any order: + | player.age | + | 36 | Scenario: Fetch prop on multiple tags When executing query: """ FETCH PROP ON bachelor, team, player hash("Tim Duncan"), hash("Boris Diaw") YIELD player.name, player.age, team.name, bachelor.name, bachelor.speciality """ - Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: - | VertexID | player.name | player.age | team.name | bachelor.name | bachelor.speciality | - | "Boris Diaw" | "Boris Diaw" | 36 | EMPTY | EMPTY | EMPTY | - | "Tim Duncan" | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | + Then the result should be, in any order, with relax comparison: + | player.name | player.age | team.name | bachelor.name | bachelor.speciality | + | "Boris Diaw" | 36 | EMPTY | EMPTY | EMPTY | + | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | When executing query: """ FETCH PROP ON player, team hash("Tim Duncan"),hash("Boris Diaw") YIELD player.name, team.name """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | team.name | - | "Boris Diaw" | "Boris Diaw" | EMPTY | - | "Tim Duncan" | "Tim Duncan" | EMPTY | + Then the result should be, in any order: + | player.name | team.name | + | "Boris Diaw" | EMPTY | + | "Tim Duncan" | EMPTY | When executing query: """ FETCH PROP ON player, team hash("Boris Diaw"),hash("Boris Diaw") YIELD player.name, team.name """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | team.name | - | "Boris Diaw" | "Boris Diaw" | EMPTY | - | "Boris Diaw" | "Boris Diaw" | EMPTY | + Then the result should be, in any order: + | player.name | team.name | + | "Boris Diaw" | EMPTY | + | "Boris Diaw" | EMPTY | When executing query: """ FETCH PROP ON team, player, bachelor hash("Boris Diaw") YIELD player.name, player.age, team.name, bachelor.name, bachelor.speciality """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | team.name | bachelor.name | bachelor.speciality | - | "Boris Diaw" | "Boris Diaw" | 36 | EMPTY | EMPTY | EMPTY | + Then the result should be, in any order: + | player.name | player.age | team.name | bachelor.name | bachelor.speciality | + | "Boris Diaw" | 36 | EMPTY | EMPTY | EMPTY | When executing query: """ FETCH PROP ON player, team, bachelor hash("Tim Duncan") YIELD player.name, team.name, bachelor.name """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | team.name | bachelor.name | - | "Tim Duncan" | "Tim Duncan" | EMPTY | "Tim Duncan" | + Then the result should be, in any order: + | player.name | team.name | bachelor.name | + | "Tim Duncan" | EMPTY | "Tim Duncan" | Scenario: Fetch from pipe When executing query: @@ -107,10 +107,10 @@ Feature: Fetch Int Vid Vertices GO FROM hash('Boris Diaw') over like YIELD like._dst as id | FETCH PROP ON player $-.id YIELD player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | - | "Tony Parker" | "Tony Parker" | 36 | - | "Tim Duncan" | "Tim Duncan" | 42 | + Then the result should be, in any order: + | player.name | player.age | + | "Tony Parker" | 36 | + | "Tim Duncan" | 42 | # empty input When executing query: """ @@ -118,7 +118,7 @@ Feature: Fetch Int Vid Vertices FETCH PROP ON player $-.id yield player.name """ Then the result should be, in any order: - | VertexID | player.name | + | player.name | When executing query: """ GO FROM hash('NON EXIST VERTEX ID') over serve YIELD serve._dst as id, serve.start_year as start | @@ -126,55 +126,55 @@ Feature: Fetch Int Vid Vertices FETCH PROP ON player $-.id yield player.name """ Then the result should be, in any order: - | VertexID | player.name | + | player.name | # Fetch prop on multi tags of vertices from pipe When executing query: """ GO FROM hash("Boris Diaw") over like YIELD like._dst as id | FETCH PROP ON player, team, bachelor $-.id YIELD player.name, player.age, team.name, bachelor.name, bachelor.speciality """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | team.name | bachelor.name | bachelor.speciality | - | "Tim Duncan" | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | - | "Tony Parker" | "Tony Parker" | 36 | EMPTY | EMPTY | EMPTY | + Then the result should be, in any order: + | player.name | player.age | team.name | bachelor.name | bachelor.speciality | + | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | + | "Tony Parker" | 36 | EMPTY | EMPTY | EMPTY | When executing query: """ GO FROM hash('Boris Diaw') over like YIELD like._dst as id | FETCH PROP ON player, bachelor $-.id YIELD player.name, player.age, bachelor.name, bachelor.speciality """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | bachelor.name | bachelor.speciality | - | "Tony Parker" | "Tony Parker" | 36 | EMPTY | EMPTY | - | "Tim Duncan" | "Tim Duncan" | 42 | "Tim Duncan" | "psychology" | + Then the result should be, in any order: + | player.name | player.age | bachelor.name | bachelor.speciality | + | "Tony Parker" | 36 | EMPTY | EMPTY | + | "Tim Duncan" | 42 | "Tim Duncan" | "psychology" | Scenario: Fetch Vertices works with variable. When executing query: """ $var = GO FROM hash('Boris Diaw') over like YIELD like._dst as id; FETCH PROP ON player $var.id YIELD player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | - | "Tony Parker" | "Tony Parker" | 36 | - | "Tim Duncan" | "Tim Duncan" | 42 | + Then the result should be, in any order: + | player.name | player.age | + | "Tony Parker" | 36 | + | "Tim Duncan" | 42 | # Fetch prop on multi tags of vertices from variable When executing query: """ $var = GO FROM hash("Boris Diaw") over like YIELD like._dst as id; FETCH PROP ON player, team, bachelor $var.id YIELD player.name, player.age, team.name, bachelor.name, bachelor.speciality """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | team.name | bachelor.name | bachelor.speciality | - | "Tim Duncan" | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | - | "Tony Parker" | "Tony Parker" | 36 | EMPTY | EMPTY | EMPTY | + Then the result should be, in any order: + | player.name | player.age | team.name | bachelor.name | bachelor.speciality | + | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | + | "Tony Parker" | 36 | EMPTY | EMPTY | EMPTY | # Fetch prop on * from variable When executing query: """ $var = GO FROM hash("Boris Diaw") over like YIELD like._dst as id; FETCH PROP ON * $var.id YIELD player.name, team.name, bachelor.name """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | team.name | bachelor.name | - | "Tony Parker" | "Tony Parker" | EMPTY | EMPTY | - | "Tim Duncan" | "Tim Duncan" | EMPTY | "Tim Duncan" | + Then the result should be, in any order: + | player.name | team.name | bachelor.name | + | "Tony Parker" | EMPTY | EMPTY | + | "Tim Duncan" | EMPTY | "Tim Duncan" | @skip Scenario: Fetch Vertices works with uuid() and YIELD @@ -183,16 +183,16 @@ Feature: Fetch Int Vid Vertices FETCH PROP ON player uuid('Boris Diaw') YIELD player.name, player.age """ Then the result should be, in any order, with relax comparison: - | VertexID | player.name | player.age | - | -7391649757168799460 | "Boris Diaw" | 36 | + | player.name | player.age | + | "Boris Diaw" | 36 | # without YIELD When executing query: """ FETCH PROP ON player uuid('Boris Diaw') """ Then the result should be, in any order, with relax comparison: - | VertexID | player.name | player.age | - | -7391649757168799460 | "Boris Diaw" | 36 | + | player.name | player.age | + | "Boris Diaw" | 36 | Scenario: Fetch prop on * # on not existing vertex @@ -201,65 +201,65 @@ Feature: Fetch Int Vid Vertices FETCH PROP ON * hash('NON EXIST VERTEX ID') yield player.name """ Then the result should be, in any order: - | VertexID | player.name | + | player.name | When executing query: """ - FETCH PROP ON * hash('NON EXIST VERTEX ID') + FETCH PROP ON * hash('NON EXIST VERTEX ID') YIELD vertex as node """ Then the result should be, in any order: - | vertices_ | + | node | # on existing vertex When executing query: """ FETCH PROP ON * hash('Boris Diaw') yield player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | - | "Boris Diaw" | "Boris Diaw" | 36 | + Then the result should be, in any order: + | player.name | player.age | + | "Boris Diaw" | 36 | # on multiple vertices When executing query: """ FETCH PROP ON * hash('Boris Diaw'), hash('Boris Diaw') yield player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | - | "Boris Diaw" | "Boris Diaw" | 36 | - | "Boris Diaw" | "Boris Diaw" | 36 | + Then the result should be, in any order: + | player.name | player.age | + | "Boris Diaw" | 36 | + | "Boris Diaw" | 36 | When executing query: """ FETCH PROP ON * hash('Tim Duncan'), hash('Boris Diaw') yield player.name, bachelor.name """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | bachelor.name | - | "Boris Diaw" | "Boris Diaw" | EMPTY | - | "Tim Duncan" | "Tim Duncan" | "Tim Duncan" | + Then the result should be, in any order: + | player.name | bachelor.name | + | "Boris Diaw" | EMPTY | + | "Tim Duncan" | "Tim Duncan" | # from pipe When executing query: """ YIELD hash('Boris Diaw') as id | FETCH PROP ON * $-.id yield player.name, player.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | - | "Boris Diaw" | "Boris Diaw" | 36 | + Then the result should be, in any order: + | player.name | player.age | + | "Boris Diaw" | 36 | When executing query: """ YIELD hash('Tim Duncan') as id | FETCH PROP ON * $-.id yield player.name, player.age, bachelor.name, bachelor.speciality """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | bachelor.name | bachelor.speciality | - | "Tim Duncan" | "Tim Duncan" | 42 | "Tim Duncan" | "psychology" | + Then the result should be, in any order: + | player.name | player.age | bachelor.name | bachelor.speciality | + | "Tim Duncan" | 42 | "Tim Duncan" | "psychology" | When executing query: """ - FETCH PROP ON * hash('Tim Duncan') + FETCH PROP ON * hash('Tim Duncan') YIELD vertex as node """ Then the result should be, in any order, with relax comparison: - | vertices_ | + | node | | ("Tim Duncan":player:bachelor) | Scenario: Fetch and Yield id(v) When executing query: """ - FETCH PROP ON player hash('Boris Diaw'), hash('Tony Parker') | YIELD id($-.vertices_) as id + FETCH PROP ON player hash('Boris Diaw'), hash('Tony Parker') YIELD vertex as node | YIELD id($-.node) as id """ Then the result should be, in any order, and the columns 0 should be hashed: | id | @@ -269,11 +269,11 @@ Feature: Fetch Int Vid Vertices Scenario: Fetch vertices and then GO When executing query: """ - FETCH PROP ON player hash('Tony Parker') YIELD player.name as Name | - GO FROM $-.VertexID OVER like + FETCH PROP ON player hash('Tony Parker') YIELD player.name as Name, id(vertex) as id | + GO FROM $-.id OVER like YIELD dst(edge) as dst """ Then the result should be, in any order, and the columns 0 should be hashed: - | like._dst | + | dst | | "LaMarcus Aldridge" | | "Manu Ginobili" | | "Tim Duncan" | @@ -333,7 +333,7 @@ Feature: Fetch Int Vid Vertices # only constant list or single colume of data is allowed in piped FETCH clause When executing query: """ - GO FROM 'Boris Diaw' over like YIELD like._src as src, like._dst as dst | FETCH PROP ON player $-.src, $-.dst; + GO FROM 'Boris Diaw' over like YIELD like._src as src, like._dst as dst | FETCH PROP ON player $-.src, $-.dst YIELD vertex as node; """ Then a SyntaxError should be raised at runtime: @@ -346,7 +346,7 @@ Feature: Fetch Int Vid Vertices # $- is not supported When executing query: """ - GO FROM hash('NON EXIST VERTEX ID') OVER serve | FETCH PROP ON team $- + GO FROM hash('NON EXIST VERTEX ID') OVER serve YIELD dst(edge) as id | FETCH PROP ON team $- YIELD vertex as node """ Then a SyntaxError should be raised at runtime: @@ -355,64 +355,64 @@ Feature: Fetch Int Vid Vertices """ FETCH PROP ON * hash('Boris Diaw') YIELD id(vertex) """ - Then the result should be, in any order, and the columns 0, 1 should be hashed: - | VertexID | id(VERTEX) | - | "Boris Diaw" | "Boris Diaw" | + Then the result should be, in any order, and the columns 0 should be hashed: + | id(VERTEX) | + | "Boris Diaw" | When executing query: """ FETCH PROP ON * hash('Boris Diaw') YIELD id(vertex), player.age """ - Then the result should be, in any order, and the columns 0, 1 should be hashed: - | VertexID | id(VERTEX) | player.age | - | "Boris Diaw" | "Boris Diaw" | 36 | + Then the result should be, in any order, and the columns 0 should be hashed: + | id(VERTEX) | player.age | + | "Boris Diaw" | 36 | When executing query: """ FETCH PROP ON * hash('Boris Diaw') YIELD id(vertex), player.age, vertex as node """ - Then the result should be, in any order, and the columns 0, 1 should be hashed: - | VertexID | id(VERTEX) | player.age | node | - | "Boris Diaw" | "Boris Diaw" | 36 | ("Boris Diaw":player{name:"Boris Diaw", age:36}) | + Then the result should be, in any order, and the columns 0 should be hashed: + | id(VERTEX) | player.age | node | + | "Boris Diaw" | 36 | ("Boris Diaw":player{name:"Boris Diaw", age:36}) | When executing query: """ FETCH PROP ON * hash('Boris Diaw') YIELD vertex as node """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | node | - | "Boris Diaw" | ("Boris Diaw":player{name:"Boris Diaw", age:36}) | + Then the result should be, in any order: + | node | + | ("Boris Diaw":player{name:"Boris Diaw", age:36}) | When executing query: """ FETCH PROP ON * hash("Tim Duncan") YIELD player.name, player.age, team.name, bachelor.name, bachelor.speciality, vertex as node """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | player.age | team.name | bachelor.name | bachelor.speciality | node | - | "Tim Duncan" | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | + Then the result should be, in any order: + | player.name | player.age | team.name | bachelor.name | bachelor.speciality | node | + | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | When executing query: """ GO FROM hash("Tim Duncan") OVER like YIELD like._dst as id | FETCH PROP ON * $-.id YIELD VERTEX as node """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | node | - | "Manu Ginobili" | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | - | "Tony Parker" | ("Tony Parker" :player{age: 36, name: "Tony Parker"}) | + Then the result should be, in any order: + | node | + | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | + | ("Tony Parker" :player{age: 36, name: "Tony Parker"}) | When executing query: """ FETCH PROP ON * hash('NON EXIST VERTEX ID'), hash('Boris Diaw') yield player.name, id(vertex) """ - Then the result should be, in any order, and the columns 0, 2 should be hashed: - | VertexID | player.name | id(VERTEX) | - | "Boris Diaw" | "Boris Diaw" | "Boris Diaw" | + Then the result should be, in any order, and the columns 1 should be hashed: + | player.name | id(VERTEX) | + | "Boris Diaw" | "Boris Diaw" | When executing query: """ FETCH PROP ON player hash('Tim Duncan') YIELD id(vertex), properties(vertex).name as name, properties(vertex) """ - Then the result should be, in any order, and the columns 0, 1 should be hashed: - | VertexID | id(VERTEX) | name | properties(VERTEX) | - | "Tim Duncan" | "Tim Duncan" | "Tim Duncan" | {age: 42, name: "Tim Duncan"} | + Then the result should be, in any order, and the columns 0 should be hashed: + | id(VERTEX) | name | properties(VERTEX) | + | "Tim Duncan" | "Tim Duncan" | {age: 42, name: "Tim Duncan"} | When executing query: """ FETCH PROP ON * hash('Tim Duncan') YIELD id(vertex), keys(vertex) as keys, tags(vertex) as tagss, properties(vertex) as props """ - Then the result should be, in any order, and the columns 0, 1 should be hashed: - | VertexID | id(VERTEX) | keys | tagss | props | - | "Tim Duncan" | "Tim Duncan" | ["age", "name", "speciality"] | ["bachelor", "player"] | {age: 42, name: "Tim Duncan", speciality: "psychology"} | + Then the result should be, in any order, and the columns 0 should be hashed: + | id(VERTEX) | keys | tagss | props | + | "Tim Duncan" | ["age", "name", "speciality"] | ["bachelor", "player"] | {age: 42, name: "Tim Duncan", speciality: "psychology"} | diff --git a/tests/tck/features/fetch/FetchVertices.strVid.feature b/tests/tck/features/fetch/FetchVertices.strVid.feature index ad1dc516c01..ed23bf04603 100644 --- a/tests/tck/features/fetch/FetchVertices.strVid.feature +++ b/tests/tck/features/fetch/FetchVertices.strVid.feature @@ -9,37 +9,37 @@ Feature: Fetch String Vertices FETCH PROP ON player 'Boris Diaw' YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | - | "Boris Diaw" | "Boris Diaw" | 36 | + | player.name | player.age | + | "Boris Diaw" | 36 | # Fetch Vertices yield duplicate columns When executing query: """ FETCH PROP ON player 'Boris Diaw' YIELD player.name, player.name """ Then the result should be, in any order: - | VertexID | player.name | player.name | - | "Boris Diaw" | "Boris Diaw" | "Boris Diaw" | + | player.name | player.name | + | "Boris Diaw" | "Boris Diaw" | When executing query: """ FETCH PROP ON player 'Boris Diaw' YIELD player.name, player.age, player.age > 30 """ Then the result should be, in any order: - | VertexID | player.name | player.age | (player.age>30) | - | "Boris Diaw" | "Boris Diaw" | 36 | True | + | player.name | player.age | (player.age>30) | + | "Boris Diaw" | 36 | True | # Fetch Vertices without YIELD When executing query: """ - FETCH PROP ON bachelor 'Tim Duncan' + FETCH PROP ON bachelor 'Tim Duncan' YIELD vertex as node """ Then the result should be, in any order: - | vertices_ | + | node | | ("Tim Duncan":bachelor{name:"Tim Duncan",speciality:"psychology"}) | When executing query: """ - FETCH PROP ON player 'Boris Diaw' + FETCH PROP ON player 'Boris Diaw' YIELD vertex as node """ Then the result should be, in any order: - | vertices_ | + | node | | ("Boris Diaw":player{name:"Boris Diaw", age:36}) | Scenario: Fetch Vertices works with ORDER BY @@ -50,9 +50,9 @@ Feature: Fetch String Vertices ORDER BY $-.name """ Then the result should be, in order: - | VertexID | name | player.age | - | "Tim Duncan" | "Tim Duncan" | 42 | - | "Tony Parker" | "Tony Parker" | 36 | + | name | player.age | + | "Tim Duncan" | 42 | + | "Tony Parker" | 36 | Scenario: Fetch Vertices works with DISTINCT When executing query: @@ -60,23 +60,23 @@ Feature: Fetch String Vertices FETCH PROP ON player 'Boris Diaw', 'Boris Diaw' YIELD DISTINCT player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | - | "Boris Diaw" | "Boris Diaw" | 36 | + | player.name | player.age | + | "Boris Diaw" | 36 | When executing query: """ FETCH PROP ON player "Boris Diaw", "Tony Parker" YIELD DISTINCT player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | - | "Boris Diaw" | "Boris Diaw" | 36 | - | "Tony Parker" | "Tony Parker" | 36 | + | player.name | player.age | + | "Boris Diaw" | 36 | + | "Tony Parker" | 36 | When executing query: """ FETCH PROP ON player 'Boris Diaw', 'Boris Diaw' YIELD DISTINCT player.age """ Then the result should be, in any order: - | VertexID | player.age | - | "Boris Diaw" | 36 | + | player.age | + | 36 | Scenario: Fetch prop on multiple tags, multiple vertices When executing query: @@ -84,39 +84,39 @@ Feature: Fetch String Vertices FETCH PROP ON bachelor, team, player "Tim Duncan", "Boris Diaw" YIELD player.name, player.age, team.name, bachelor.name, bachelor.speciality """ Then the result should be, in any order: - | VertexID | player.name | player.age | team.name | bachelor.name | bachelor.speciality | - | "Boris Diaw" | "Boris Diaw" | 36 | EMPTY | EMPTY | EMPTY | - | "Tim Duncan" | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | + | player.name | player.age | team.name | bachelor.name | bachelor.speciality | + | "Boris Diaw" | 36 | EMPTY | EMPTY | EMPTY | + | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | When executing query: """ FETCH PROP ON player, team "Tim Duncan","Boris Diaw" YIELD player.name, team.name """ Then the result should be, in any order: - | VertexID | player.name | team.name | - | "Boris Diaw" | "Boris Diaw" | EMPTY | - | "Tim Duncan" | "Tim Duncan" | EMPTY | + | player.name | team.name | + | "Boris Diaw" | EMPTY | + | "Tim Duncan" | EMPTY | When executing query: """ FETCH PROP ON player, team "Boris Diaw","Boris Diaw" YIELD player.name, team.name """ Then the result should be, in any order: - | VertexID | player.name | team.name | - | "Boris Diaw" | "Boris Diaw" | EMPTY | - | "Boris Diaw" | "Boris Diaw" | EMPTY | + | player.name | team.name | + | "Boris Diaw" | EMPTY | + | "Boris Diaw" | EMPTY | When executing query: """ FETCH PROP ON team, player, bachelor "Boris Diaw" YIELD player.name, player.age, team.name, bachelor.name, bachelor.speciality """ Then the result should be, in any order: - | VertexID | player.name | player.age | team.name | bachelor.name | bachelor.speciality | - | "Boris Diaw" | "Boris Diaw" | 36 | EMPTY | EMPTY | EMPTY | + | player.name | player.age | team.name | bachelor.name | bachelor.speciality | + | "Boris Diaw" | 36 | EMPTY | EMPTY | EMPTY | When executing query: """ FETCH PROP ON player, team, bachelor "Tim Duncan" YIELD player.name, team.name, bachelor.name """ Then the result should be, in any order: - | VertexID | player.name | team.name | bachelor.name | - | "Tim Duncan" | "Tim Duncan" | EMPTY | "Tim Duncan" | + | player.name | team.name | bachelor.name | + | "Tim Duncan" | EMPTY | "Tim Duncan" | Scenario: Fetch prop on not existing vertex When executing query: @@ -124,20 +124,20 @@ Feature: Fetch String Vertices FETCH PROP ON player 'NON EXIST VERTEX ID' yield player.name """ Then the result should be, in any order: - | VertexID | player.name | + | player.name | When executing query: """ FETCH PROP ON player 'NON EXIST VERTEX ID', "Boris Diaw" yield player.name """ Then the result should be, in any order: - | VertexID | player.name | - | "Boris Diaw" | "Boris Diaw" | + | player.name | + | "Boris Diaw" | When executing query: """ - FETCH PROP ON * 'NON EXIST VERTEX ID' + FETCH PROP ON * 'NON EXIST VERTEX ID' YIELD vertex as node """ Then the result should be, in any order: - | vertices_ | + | node | Scenario: Fetch prop on * When executing query: @@ -145,61 +145,61 @@ Feature: Fetch String Vertices FETCH PROP ON * 'Boris Diaw' yield player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | - | "Boris Diaw" | "Boris Diaw" | 36 | + | player.name | player.age | + | "Boris Diaw" | 36 | When executing query: """ FETCH PROP ON * 'Boris Diaw' yield player.name, player.age, team.name, bachelor.name, bachelor.speciality """ Then the result should be, in any order: - | VertexID | player.name | player.age | team.name | bachelor.name | bachelor.speciality | - | "Boris Diaw" | "Boris Diaw" | 36 | EMPTY | EMPTY | EMPTY | + | player.name | player.age | team.name | bachelor.name | bachelor.speciality | + | "Boris Diaw" | 36 | EMPTY | EMPTY | EMPTY | When executing query: """ FETCH PROP ON * "Tim Duncan" YIELD player.name, player.age, team.name, bachelor.name, bachelor.speciality """ Then the result should be, in any order: - | VertexID | player.name | player.age | team.name | bachelor.name | bachelor.speciality | - | "Tim Duncan" | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | + | player.name | player.age | team.name | bachelor.name | bachelor.speciality | + | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | # Fetch prop on * with not existing vertex When executing query: """ FETCH PROP ON * 'NON EXIST VERTEX ID' yield player.name """ Then the result should be, in any order: - | VertexID | player.name | + | player.name | When executing query: """ FETCH PROP ON * 'NON EXIST VERTEX ID', 'Boris Diaw' yield player.name """ Then the result should be, in any order: - | VertexID | player.name | - | "Boris Diaw" | "Boris Diaw" | + | player.name | + | "Boris Diaw" | # Fetch prop on * with multiple vertices When executing query: """ FETCH PROP ON * 'Boris Diaw', 'Boris Diaw' yield player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | - | "Boris Diaw" | "Boris Diaw" | 36 | - | "Boris Diaw" | "Boris Diaw" | 36 | + | player.name | player.age | + | "Boris Diaw" | 36 | + | "Boris Diaw" | 36 | When executing query: """ FETCH PROP ON * 'Tim Duncan', 'Boris Diaw' YIELD player.name, bachelor.name """ Then the result should be, in any order: - | VertexID | player.name | bachelor.name | - | "Tim Duncan" | "Tim Duncan" | "Tim Duncan" | - | "Boris Diaw" | "Boris Diaw" | EMPTY | + | player.name | bachelor.name | + | "Tim Duncan" | "Tim Duncan" | + | "Boris Diaw" | EMPTY | When executing query: """ FETCH PROP ON * "Tim Duncan", "Boris Diaw" YIELD player.name, player.age, team.name, bachelor.name, bachelor.speciality """ Then the result should be, in any order: - | VertexID | player.name | player.age | team.name | bachelor.name | bachelor.speciality | - | "Tim Duncan" | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | - | "Boris Diaw" | "Boris Diaw" | 36 | EMPTY | EMPTY | EMPTY | + | player.name | player.age | team.name | bachelor.name | bachelor.speciality | + | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | + | "Boris Diaw" | 36 | EMPTY | EMPTY | EMPTY | Scenario: Fetch from pipe # Fetch prop on one tag of vertices from pipe @@ -208,18 +208,18 @@ Feature: Fetch String Vertices GO FROM 'Boris Diaw' over like YIELD like._dst as id | FETCH PROP ON player $-.id YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | - | "Tony Parker" | "Tony Parker" | 36 | - | "Tim Duncan" | "Tim Duncan" | 42 | + | player.name | player.age | + | "Tony Parker" | 36 | + | "Tim Duncan" | 42 | When executing query: """ GO FROM 'Boris Diaw' over like YIELD like._dst as id | FETCH PROP ON player, bachelor $-.id YIELD player.name, player.age, bachelor.name, bachelor.speciality """ Then the result should be, in any order: - | VertexID | player.name | player.age | bachelor.name | bachelor.speciality | - | "Tony Parker" | "Tony Parker" | 36 | EMPTY | EMPTY | - | "Tim Duncan" | "Tim Duncan" | 42 | "Tim Duncan" | "psychology" | + | player.name | player.age | bachelor.name | bachelor.speciality | + | "Tony Parker" | 36 | EMPTY | EMPTY | + | "Tim Duncan" | 42 | "Tim Duncan" | "psychology" | # Fetch prop on multi tags of vertices from pipe When executing query: """ @@ -227,25 +227,25 @@ Feature: Fetch String Vertices FETCH PROP ON player, team, bachelor $-.id YIELD player.name, player.age, team.name, bachelor.name, bachelor.speciality """ Then the result should be, in any order: - | VertexID | player.name | player.age | team.name | bachelor.name | bachelor.speciality | - | "Tim Duncan" | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | - | "Tony Parker" | "Tony Parker" | 36 | EMPTY | EMPTY | EMPTY | + | player.name | player.age | team.name | bachelor.name | bachelor.speciality | + | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | + | "Tony Parker" | 36 | EMPTY | EMPTY | EMPTY | When executing query: """ GO FROM 'Boris Diaw' over like YIELD like._dst as id | FETCH PROP ON player, bachelor $-.id YIELD player.name, player.age, bachelor.name, bachelor.speciality """ Then the result should be, in any order: - | VertexID | player.name | player.age | bachelor.name | bachelor.speciality | - | "Tony Parker" | "Tony Parker" | 36 | EMPTY | EMPTY | - | "Tim Duncan" | "Tim Duncan" | 42 | "Tim Duncan" | "psychology" | + | player.name | player.age | bachelor.name | bachelor.speciality | + | "Tony Parker" | 36 | EMPTY | EMPTY | + | "Tim Duncan" | 42 | "Tim Duncan" | "psychology" | # Fetch vertices with empty input When executing query: """ GO FROM 'NON EXIST VERTEX ID' over like YIELD like._dst as id | FETCH PROP ON player $-.id yield player.name """ Then the result should be, in any order: - | VertexID | player.name | + | player.name | When executing query: """ GO FROM 'NON EXIST VERTEX ID' over serve YIELD serve._dst as id, serve.start_year as start | @@ -253,24 +253,24 @@ Feature: Fetch String Vertices FETCH PROP ON player $-.id yield player.name """ Then the result should be, in any order: - | VertexID | player.name | + | player.name | # Fetch * from input When executing query: """ YIELD 'Tim Duncan' as id | FETCH PROP ON * $-.id yield player.name, player.age, bachelor.name, bachelor.speciality """ Then the result should be, in any order: - | VertexID | player.name | player.age | bachelor.name | bachelor.speciality | - | "Tim Duncan" | "Tim Duncan" | 42 | "Tim Duncan" | "psychology" | + | player.name | player.age | bachelor.name | bachelor.speciality | + | "Tim Duncan" | 42 | "Tim Duncan" | "psychology" | When executing query: """ GO FROM "Boris Diaw" over like YIELD like._dst as id | FETCH PROP ON * $-.id YIELD player.name, player.age, team.name, bachelor.name, bachelor.speciality """ Then the result should be, in any order: - | VertexID | player.name | player.age | team.name | bachelor.name | bachelor.speciality | - | "Tony Parker" | "Tony Parker" | 36 | EMPTY | EMPTY | EMPTY | - | "Tim Duncan" | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | + | player.name | player.age | team.name | bachelor.name | bachelor.speciality | + | "Tony Parker" | 36 | EMPTY | EMPTY | EMPTY | + | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | Scenario: fetch from varibles When executing query: @@ -278,17 +278,17 @@ Feature: Fetch String Vertices $var = GO FROM 'Boris Diaw' over like YIELD like._dst as id; FETCH PROP ON player $var.id YIELD player.name, player.age """ Then the result should be, in any order: - | VertexID | player.name | player.age | - | "Tony Parker" | "Tony Parker" | 36 | - | "Tim Duncan" | "Tim Duncan" | 42 | + | player.name | player.age | + | "Tony Parker" | 36 | + | "Tim Duncan" | 42 | When executing query: """ $var = GO FROM "Boris Diaw" over like YIELD like._dst as id; FETCH PROP ON * $var.id YIELD player.name, team.name, bachelor.name """ Then the result should be, in any order: - | VertexID | player.name | team.name | bachelor.name | - | "Tony Parker" | "Tony Parker" | EMPTY | EMPTY | - | "Tim Duncan" | "Tim Duncan" | EMPTY | "Tim Duncan" | + | player.name | team.name | bachelor.name | + | "Tony Parker" | EMPTY | EMPTY | + | "Tim Duncan" | EMPTY | "Tim Duncan" | # Fetch prop on multi tags of vertices from variable When executing query: """ @@ -296,14 +296,14 @@ Feature: Fetch String Vertices FETCH PROP ON player, team, bachelor $var.id YIELD player.name, player.age, team.name, bachelor.name, bachelor.speciality """ Then the result should be, in any order: - | VertexID | player.name | player.age | team.name | bachelor.name | bachelor.speciality | - | "Tim Duncan" | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | - | "Tony Parker" | "Tony Parker" | 36 | EMPTY | EMPTY | EMPTY | + | player.name | player.age | team.name | bachelor.name | bachelor.speciality | + | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | + | "Tony Parker" | 36 | EMPTY | EMPTY | EMPTY | Scenario: Fetch and Yield id(v) When executing query: """ - FETCH PROP ON player 'Boris Diaw', 'Tony Parker' | YIELD id($-.vertices_) as id + FETCH PROP ON player 'Boris Diaw', 'Tony Parker' YIELD vertex as node | YIELD id($-.node) as id """ Then the result should be, in any order: | id | @@ -314,13 +314,13 @@ Feature: Fetch String Vertices Scenario: Output fetch result to graph traverse When executing query: """ - FETCH PROP ON player 'NON EXIST VERTEX ID' | go from id($-.vertices_) over like yield like._dst + FETCH PROP ON player 'NON EXIST VERTEX ID' YIELD vertex as node | go from id($-.node) over like yield like._dst """ Then the result should be, in any order: | like._dst | When executing query: """ - FETCH PROP ON player "Tim Duncan" | go from id($-.vertices_) over like yield like._dst + FETCH PROP ON player "Tim Duncan" YIELD vertex as node | go from id($-.node) over like yield like._dst """ Then the result should be, in any order: | like._dst | @@ -328,7 +328,7 @@ Feature: Fetch String Vertices | "Tony Parker" | When executing query: """ - FETCH PROP ON player "Tim Duncan", "Yao Ming" | go from id($-.vertices_) over like yield like._dst + FETCH PROP ON player "Tim Duncan", "Yao Ming" YIELD vertex as node | go from id($-.node) over like yield like._dst """ Then the result should be, in any order: | like._dst | @@ -357,7 +357,7 @@ Feature: Fetch String Vertices When executing query: """ FETCH PROP ON player 'Tony Parker' YIELD player.name as Name | - GO FROM $-.Name OVER like + GO FROM $-.Name OVER like YIELD like._dst """ Then the result should be, in any order: | like._dst | @@ -366,11 +366,11 @@ Feature: Fetch String Vertices | "Tim Duncan" | When executing query: """ - FETCH PROP ON player 'Tony Parker' YIELD player.name as Name | - GO FROM $-.VertexID OVER like + FETCH PROP ON player 'Tony Parker' YIELD id(vertex) as id, player.name as Name | + GO FROM $-.id OVER like YIELD dst(edge) as dst """ Then the result should be, in any order: - | like._dst | + | dst | | "LaMarcus Aldridge" | | "Manu Ginobili" | | "Tim Duncan" | @@ -467,63 +467,63 @@ Feature: Fetch String Vertices FETCH PROP ON * 'Boris Diaw' YIELD id(vertex) """ Then the result should be, in any order: - | VertexID | id(VERTEX) | - | "Boris Diaw" | "Boris Diaw" | + | id(VERTEX) | + | "Boris Diaw" | When executing query: """ FETCH PROP ON * 'Boris Diaw' YIELD id(vertex), player.age """ Then the result should be, in any order: - | VertexID | id(VERTEX) | player.age | - | "Boris Diaw" | "Boris Diaw" | 36 | + | id(VERTEX) | player.age | + | "Boris Diaw" | 36 | When executing query: """ FETCH PROP ON * 'Boris Diaw' YIELD id(vertex), player.age, vertex as node """ Then the result should be, in any order: - | VertexID | id(VERTEX) | player.age | node | - | "Boris Diaw" | "Boris Diaw" | 36 | ("Boris Diaw":player{name:"Boris Diaw", age:36}) | + | id(VERTEX) | player.age | node | + | "Boris Diaw" | 36 | ("Boris Diaw":player{name:"Boris Diaw", age:36}) | When executing query: """ FETCH PROP ON * 'Boris Diaw' YIELD vertex as node """ Then the result should be, in any order: - | VertexID | node | - | "Boris Diaw" | ("Boris Diaw":player{name:"Boris Diaw", age:36}) | + | node | + | ("Boris Diaw":player{name:"Boris Diaw", age:36}) | When executing query: """ FETCH PROP ON * "Tim Duncan" YIELD player.name, player.age, team.name, bachelor.name, bachelor.speciality, vertex as node """ Then the result should be, in any order: - | VertexID | player.name | player.age | team.name | bachelor.name | bachelor.speciality | node | - | "Tim Duncan" | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | + | player.name | player.age | team.name | bachelor.name | bachelor.speciality | node | + | "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | When executing query: """ GO FROM "Tim Duncan" OVER like YIELD like._dst as id | FETCH PROP ON * $-.id YIELD vertex as node """ Then the result should be, in any order: - | VertexID | node | - | "Manu Ginobili" | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | - | "Tony Parker" | ("Tony Parker" :player{age: 36, name: "Tony Parker"}) | + | node | + | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | + | ("Tony Parker" :player{age: 36, name: "Tony Parker"}) | When executing query: """ FETCH PROP ON * 'NON EXIST VERTEX ID', 'Boris Diaw' yield player.name, id(vertex) """ Then the result should be, in any order: - | VertexID | player.name | id(VERTEX) | - | "Boris Diaw" | "Boris Diaw" | "Boris Diaw" | + | player.name | id(VERTEX) | + | "Boris Diaw" | "Boris Diaw" | When executing query: """ FETCH PROP ON player 'Tim Duncan' YIELD id(vertex), properties(vertex).name as name, properties(vertex) """ Then the result should be, in any order: - | VertexID | id(VERTEX) | name | properties(VERTEX) | - | "Tim Duncan" | "Tim Duncan" | "Tim Duncan" | {age: 42, name: "Tim Duncan"} | + | id(VERTEX) | name | properties(VERTEX) | + | "Tim Duncan" | "Tim Duncan" | {age: 42, name: "Tim Duncan"} | When executing query: """ FETCH PROP ON * 'Tim Duncan' YIELD id(vertex), keys(vertex) as keys, tags(vertex) as tagss, properties(vertex) as props """ Then the result should be, in any order: - | VertexID | id(VERTEX) | keys | tagss | props | - | "Tim Duncan" | "Tim Duncan" | ["age", "name", "speciality"] | ["bachelor", "player"] | {age: 42, name: "Tim Duncan", speciality: "psychology"} | + | id(VERTEX) | keys | tagss | props | + | "Tim Duncan" | ["age", "name", "speciality"] | ["bachelor", "player"] | {age: 42, name: "Tim Duncan", speciality: "psychology"} | diff --git a/tests/tck/features/geo/GeoBase.feature b/tests/tck/features/geo/GeoBase.feature index ef3847b2968..def88a51f08 100644 --- a/tests/tck/features/geo/GeoBase.feature +++ b/tests/tck/features/geo/GeoBase.feature @@ -186,38 +186,38 @@ Feature: Geo base FETCH PROP ON any_shape "101","102","103" YIELD ST_ASText(any_shape.geo); """ Then the result should be, in any order: - | VertexID | ST_ASText(any_shape.geo) | - | "102" | "LINESTRING(3 8, 4.7 73.23)" | - | "101" | "POINT(3 8)" | - | "103" | "POLYGON((0 1, 1 2, 2 3, 0 1))" | + | ST_ASText(any_shape.geo) | + | "LINESTRING(3 8, 4.7 73.23)" | + | "POINT(3 8)" | + | "POLYGON((0 1, 1 2, 2 3, 0 1))" | When executing query: """ FETCH PROP ON only_point "201","202","203" YIELD ST_ASText(only_point.geo); """ Then the result should be, in any order: - | VertexID | ST_ASText(only_point.geo) | - | "201" | "POINT(3 8)" | + | ST_ASText(only_point.geo) | + | "POINT(3 8)" | When executing query: """ FETCH PROP ON only_linestring "301","302","303" YIELD ST_ASText(only_linestring.geo); """ Then the result should be, in any order: - | VertexID | ST_ASText(only_linestring.geo) | - | "302" | "LINESTRING(3 8, 4.7 73.23)" | + | ST_ASText(only_linestring.geo) | + | "LINESTRING(3 8, 4.7 73.23)" | When executing query: """ FETCH PROP ON only_polygon "401","402","403" YIELD ST_ASText(only_polygon.geo); """ Then the result should be, in any order: - | VertexID | ST_ASText(only_polygon.geo) | - | "403" | "POLYGON((0 1, 1 2, 2 3, 0 1))" | + | ST_ASText(only_polygon.geo) | + | "POLYGON((0 1, 1 2, 2 3, 0 1))" | When executing query: """ FETCH PROP ON any_shape_edge "201"->"302" YIELD ST_ASText(any_shape_edge.geo); """ Then the result should be, in any order: - | any_shape_edge._src | any_shape_edge._dst | any_shape_edge._rank | ST_ASText(any_shape_edge.geo) | - | "201" | "302" | 0 | "POLYGON((0 1, 1 2, 2 3, 0 1))" | + | ST_ASText(any_shape_edge.geo) | + | "POLYGON((0 1, 1 2, 2 3, 0 1))" | # Create index on geo column When executing query: """ @@ -625,8 +625,8 @@ Feature: Geo base FETCH PROP ON any_shape "101" YIELD ST_ASText(any_shape.geo); """ Then the result should be, in any order: - | VertexID | ST_ASText(any_shape.geo) | - | "101" | "LINESTRING(3 8, 6 16)" | + | ST_ASText(any_shape.geo) | + | "LINESTRING(3 8, 6 16)" | When executing query: """ LOOKUP ON any_shape YIELD ST_ASText(any_shape.geo); @@ -656,8 +656,8 @@ Feature: Geo base FETCH PROP ON any_shape_edge "201"->"302" YIELD ST_ASText(any_shape_edge.geo); """ Then the result should be, in any order: - | any_shape_edge._src | any_shape_edge._dst | any_shape_edge._rank | ST_ASText(any_shape_edge.geo) | - | "201" | "302" | 0 | "POINT(-1 -1)" | + | ST_ASText(any_shape_edge.geo) | + | "POINT(-1 -1)" | When executing query: """ LOOKUP ON any_shape_edge YIELD ST_ASText(any_shape_edge.geo); @@ -685,7 +685,7 @@ Feature: Geo base FETCH PROP ON any_shape "101" YIELD ST_ASText(any_shape.geo); """ Then the result should be, in any order: - | VertexID | ST_ASText(any_shape.geo) | + | ST_ASText(any_shape.geo) | When executing query: """ LOOKUP ON any_shape YIELD ST_ASText(any_shape.geo); @@ -713,7 +713,7 @@ Feature: Geo base FETCH PROP ON any_shape_edge "201"->"302" YIELD ST_ASText(any_shape_edge.geo); """ Then the result should be, in any order: - | any_shape_edge._src | any_shape_edge._dst | any_shape_edge._rank | ST_ASText(any_shape_edge.geo) | + | ST_ASText(any_shape_edge.geo) | When executing query: """ LOOKUP ON any_shape_edge YIELD ST_ASText(any_shape_edge.geo); diff --git a/tests/tck/features/go/GO.IntVid.feature b/tests/tck/features/go/GO.IntVid.feature index 10636afa173..10499926386 100644 --- a/tests/tck/features/go/GO.IntVid.feature +++ b/tests/tck/features/go/GO.IntVid.feature @@ -10,7 +10,7 @@ Feature: IntegerVid Go Sentence Scenario: Integer Vid one step When executing query: """ - GO FROM hash("Tim Duncan") OVER serve + GO FROM hash("Tim Duncan") OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | @@ -36,7 +36,7 @@ Feature: IntegerVid Go Sentence | "Tony Parker" | 36 | When executing query: """ - GO FROM hash("Tim Duncan"), hash("Tim Duncan") OVER serve + GO FROM hash("Tim Duncan"), hash("Tim Duncan") OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | @@ -44,7 +44,7 @@ Feature: IntegerVid Go Sentence | "Spurs" | When executing query: """ - YIELD hash("Tim Duncan") as vid | GO FROM $-.vid OVER serve + YIELD hash("Tim Duncan") as vid | GO FROM $-.vid OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | @@ -73,8 +73,9 @@ Feature: IntegerVid Go Sentence | "Rajon Rondo" | 2017 | 2018 | "Pelicans" | When executing query: """ - GO FROM hash("Boris Diaw") OVER like YIELD like._dst as id - | GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve + GO FROM hash("Boris Diaw") OVER like YIELD like._dst as id | + GO FROM $-.id OVER like YIELD like._dst as id | + GO FROM $-.id OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | @@ -87,7 +88,7 @@ Feature: IntegerVid Go Sentence | "Trail Blazers" | When executing query: """ - GO FROM hash('Thunders') OVER serve REVERSELY + GO FROM hash('Thunders') OVER serve REVERSELY YIELD serve._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | @@ -100,7 +101,7 @@ Feature: IntegerVid Go Sentence When executing query: """ GO FROM hash("Boris Diaw") OVER like YIELD like._dst as id - |(GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve) + |(GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve YIELD serve._dst) """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | @@ -114,14 +115,14 @@ Feature: IntegerVid Go Sentence When executing query: """ GO FROM hash("No Exist Vertex Id") OVER like YIELD like._dst as id - |(GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve) + |(GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve YIELD serve._dst) """ Then the result should be, in any order, with relax comparison: | serve._dst | When executing query: """ GO FROM hash("Boris Diaw") OVER like, serve YIELD like._dst as id - |(GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve) + |(GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve YIELD serve._dst) """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | @@ -136,7 +137,7 @@ Feature: IntegerVid Go Sentence Scenario: Integer Vid assignment simple When executing query: """ - $var = GO FROM hash("Tracy McGrady") OVER like YIELD like._dst as id; GO FROM $var.id OVER like + $var = GO FROM hash("Tracy McGrady") OVER like YIELD like._dst as id; GO FROM $var.id OVER like YIELD like._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | like._dst | @@ -147,7 +148,7 @@ Feature: IntegerVid Go Sentence When executing query: """ $var = (GO FROM hash("Tracy McGrady") OVER like YIELD like._dst as id | GO FROM $-.id OVER like YIELD like._dst as id); - GO FROM $var.id OVER like + GO FROM $var.id OVER like YIELD like._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | like._dst | @@ -180,7 +181,7 @@ Feature: IntegerVid Go Sentence Scenario: Integer Vid assignment empty result When executing query: """ - $var = GO FROM -1 OVER like YIELD like._dst as id; GO FROM $var.id OVER like + $var = GO FROM -1 OVER like YIELD like._dst as id; GO FROM $var.id OVER like YIELD like._dst """ Then the result should be, in any order, with relax comparison: | like._dst | @@ -188,7 +189,7 @@ Feature: IntegerVid Go Sentence Scenario: Integer Vid variable undefined When executing query: """ - GO FROM $var OVER like + GO FROM $var OVER like YIELD like._dst """ Then a SyntaxError should be raised at runtime: syntax error near `OVER' @@ -224,7 +225,7 @@ Feature: IntegerVid Go Sentence Scenario: Integer Vid vertex noexist When executing query: """ - GO FROM hash("NON EXIST VERTEX ID") OVER serve + GO FROM hash("NON EXIST VERTEX ID") OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -246,7 +247,7 @@ Feature: IntegerVid Go Sentence """ GO FROM hash("NON EXIST VERTEX ID") OVER like YIELD like._dst as id | GO FROM $-.id OVER like YIELD like._dst as id - | GO FROM $-.id OVER serve + | GO FROM $-.id OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -254,7 +255,7 @@ Feature: IntegerVid Go Sentence """ GO FROM hash("NON EXIST VERTEX ID") OVER serve YIELD serve._dst as id, serve.start_year as start | YIELD $-.id as id WHERE $-.start > 20000 - | Go FROM $-.id over serve + | Go FROM $-.id over serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -280,7 +281,7 @@ Feature: IntegerVid Go Sentence | EMPTY | "Russell Westbrook" | When executing query: """ - GO FROM hash("Russell Westbrook") OVER * REVERSELY + GO FROM hash("Russell Westbrook") OVER * REVERSELY YIELD like._dst, serve._dst, teammate._dst """ Then the result should be, in any order, with relax comparison, and the columns 0,1,2 should be hashed: | like._dst | serve._dst | teammate._dst | @@ -299,7 +300,7 @@ Feature: IntegerVid Go Sentence | EMPTY | "Dwyane Wade" | When executing query: """ - GO FROM hash("Paul Gasol") OVER * + GO FROM hash("Paul Gasol") OVER * YIELD like._dst, serve._dst, teammate._dst """ Then the result should be, in any order, with relax comparison, and the columns 0,1,2 should be hashed: | like._dst | serve._dst | teammate._dst | @@ -335,7 +336,7 @@ Feature: IntegerVid Go Sentence When executing query: """ GO FROM hash("Boris Diaw") OVER * YIELD like._dst as id - | ( GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve ) + | ( GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve YIELD serve._dst ) """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | @@ -376,7 +377,7 @@ Feature: IntegerVid Go Sentence | EMPTY | 90 | When executing query: """ - GO FROM hash("Shaquile O\'Neal") OVER serve, like + GO FROM hash("Shaquile O\'Neal") OVER serve, like YIELD serve._dst, like._dst """ Then the result should be, in any order, with relax comparison, and the columns 0,1 should be hashed: | serve._dst | like._dst | @@ -390,7 +391,7 @@ Feature: IntegerVid Go Sentence | EMPTY | "Tim Duncan" | When executing query: """ - GO FROM hash('Russell Westbrook') OVER serve, like + GO FROM hash('Russell Westbrook') OVER serve, like YIELD serve._dst, like._dst """ Then the result should be, in any order, with relax comparison, and the columns 0,1 should be hashed: | serve._dst | like._dst | @@ -418,7 +419,7 @@ Feature: IntegerVid Go Sentence | EMPTY | "Russell Westbrook" | When executing query: """ - GO FROM hash("Russell Westbrook") OVER serve, like REVERSELY + GO FROM hash("Russell Westbrook") OVER serve, like REVERSELY YIELD serve._dst, like._dst """ Then the result should be, in any order, with relax comparison, and the columns 0,1 should be hashed: | serve._dst | like._dst | @@ -614,7 +615,7 @@ Feature: IntegerVid Go Sentence When executing query: """ GO FROM hash('Tim Duncan') OVER like YIELD like._dst AS id | - GO FROM $-.id OVER serve WHERE $-.id IN [hash('Tony Parker'), 123] + GO FROM $-.id OVER serve WHERE $-.id IN [hash('Tony Parker'), 123] YIELD serve._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | @@ -623,7 +624,7 @@ Feature: IntegerVid Go Sentence When executing query: """ GO FROM hash('Tim Duncan') OVER like YIELD like._dst AS id | - GO FROM $-.id OVER serve WHERE $-.id IN [hash('Tony Parker'), 123] AND 1 == 1 + GO FROM $-.id OVER serve WHERE $-.id IN [hash('Tony Parker'), 123] AND 1 == 1 YIELD serve._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | @@ -637,7 +638,7 @@ Feature: IntegerVid Go Sentence $A = GO FROM hash('Tim Duncan') OVER like YIELD like._dst AS dst; $rA = YIELD $A.* WHERE $A.dst == 123; RETURN $rA IF $rA IS NOT NULL; - GO FROM $A.dst OVER serve + GO FROM $A.dst OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | @@ -649,7 +650,7 @@ Feature: IntegerVid Go Sentence $A = GO FROM hash('Tim Duncan') OVER like YIELD like._dst AS dst; $rA = YIELD $A.* WHERE 1 == 1; RETURN $rA IF $rA IS NOT NULL; - GO FROM $A.dst OVER serve + GO FROM $A.dst OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | @@ -663,7 +664,7 @@ Feature: IntegerVid Go Sentence $B = GO FROM $A.dstA OVER like YIELD like._dst AS dstB; $rB = YIELD $B.* WHERE $B.dstB == 456; RETURN $rB IF $rB IS NOT NULL; - GO FROM $B.dstB OVER serve + GO FROM $B.dstB OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | @@ -831,7 +832,7 @@ Feature: IntegerVid Go Sentence When executing query: """ GO FROM hash('Manu Ginobili') OVER * REVERSELY YIELD like._dst AS id - | GO FROM $-.id OVER serve + | GO FROM $-.id OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | @@ -908,7 +909,7 @@ Feature: IntegerVid Go Sentence When executing query: """ GO FROM hash('Manu Ginobili') OVER like REVERSELY YIELD like._dst AS id - | GO FROM $-.id OVER serve + | GO FROM $-.id OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | @@ -923,14 +924,14 @@ Feature: IntegerVid Go Sentence Scenario: Integer Vid bidirect When executing query: """ - GO FROM hash('Tim Duncan') OVER serve bidirect + GO FROM hash('Tim Duncan') OVER serve bidirect YIELD serve._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | | "Spurs" | When executing query: """ - GO FROM hash('Tim Duncan') OVER like bidirect + GO FROM hash('Tim Duncan') OVER like bidirect YIELD like._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | like._dst | @@ -948,7 +949,7 @@ Feature: IntegerVid Go Sentence | "Shaquile O'Neal" | When executing query: """ - GO FROM hash('Tim Duncan') OVER serve, like bidirect + GO FROM hash('Tim Duncan') OVER serve, like bidirect YIELD serve._dst, like._dst """ Then the result should be, in any order, with relax comparison, and the columns 0,1 should be hashed: | serve._dst | like._dst | @@ -1030,7 +1031,7 @@ Feature: IntegerVid Go Sentence | "Tim Duncan" | EMPTY | EMPTY | EMPTY | "Manu Ginobili" | When executing query: """ - GO FROM hash('Tim Duncan') OVER * bidirect + GO FROM hash('Tim Duncan') OVER * bidirect YIELD like._dst, serve._dst, teammate._dst """ Then the result should be, in any order, with relax comparison, and the columns 0,1,2 should be hashed: | like._dst | serve._dst | teammate._dst | @@ -1065,20 +1066,20 @@ Feature: IntegerVid Go Sentence When executing query: """ GO FROM hash('Tim Duncan') OVER like YIELD like._dst AS id, like.likeness AS id - | GO FROM $-.id OVER serve + | GO FROM $-.id OVER serve YIELD serve._dst """ Then a SemanticError should be raised at runtime: Duplicate Column Name : `id' When executing query: """ GO FROM hash('Tim Duncan') OVER like, serve YIELD serve.start_year AS year, serve.end_year AS year, serve._dst AS id - | GO FROM $-.id OVER * + | GO FROM $-.id OVER * YIELD like._dst """ Then a SemanticError should be raised at runtime: Duplicate Column Name : `year' When executing query: """ $a = GO FROM hash('Tim Duncan') OVER * YIELD serve.start_year AS year, serve.end_year AS year, serve._dst AS id; - | GO FROM $-.id OVER serve + | GO FROM $-.id OVER serve YIELD serve._dst """ Then a SyntaxError should be raised at runtime: syntax error near `| GO FRO' @@ -1181,14 +1182,14 @@ Feature: IntegerVid Go Sentence | "Tim Duncan" | 90 | "Tim Duncan" | When executing query: """ - GO 0 TO 3 STEPS FROM hash('Tim Duncan') OVER serve + GO 0 TO 3 STEPS FROM hash('Tim Duncan') OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | | "Spurs" | When executing query: """ - GO 2 TO 3 STEPS FROM hash('Tim Duncan') OVER serve + GO 2 TO 3 STEPS FROM hash('Tim Duncan') OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -1250,7 +1251,7 @@ Feature: IntegerVid Go Sentence | "Damian Lillard" | When executing query: """ - GO 1 TO 3 STEPS FROM hash('Spurs') OVER serve REVERSELY + GO 1 TO 3 STEPS FROM hash('Spurs') OVER serve REVERSELY YIELD serve._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | @@ -1274,7 +1275,7 @@ Feature: IntegerVid Go Sentence | "Marco Belinelli" | When executing query: """ - GO 0 TO 3 STEPS FROM hash('Spurs') OVER serve REVERSELY + GO 0 TO 3 STEPS FROM hash('Spurs') OVER serve REVERSELY YIELD serve._dst """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | serve._dst | @@ -1486,19 +1487,19 @@ Feature: IntegerVid Go Sentence Scenario: Integer Vid zero step When executing query: """ - GO 0 STEPS FROM hash('Tim Duncan') OVER serve BIDIRECT + GO 0 STEPS FROM hash('Tim Duncan') OVER serve BIDIRECT YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | When executing query: """ - GO 0 STEPS FROM hash('Tim Duncan') OVER serve + GO 0 STEPS FROM hash('Tim Duncan') OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | When executing query: """ - GO 0 STEPS FROM hash('Tim Duncan') OVER like YIELD like._dst as id | GO FROM $-.id OVER serve + GO 0 STEPS FROM hash('Tim Duncan') OVER like YIELD like._dst as id | GO FROM $-.id OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -1669,7 +1670,7 @@ Feature: IntegerVid Go Sentence Scenario: Integer Vid Bugfix filter not pushdown When executing query: """ - GO FROM hash("Tim Duncan") OVER like WHERE like._dst == hash("Tony Parker") | limit 10; + GO FROM hash("Tim Duncan") OVER like WHERE like._dst == hash("Tony Parker") YIELD like._dst | limit 10; """ Then the result should be, in any order, with relax comparison, and the columns 0 should be hashed: | like._dst | @@ -1678,38 +1679,38 @@ Feature: IntegerVid Go Sentence Scenario: Step over end When executing query: """ - GO 2 STEPS FROM hash("Tim Duncan") OVER serve; + GO 2 STEPS FROM hash("Tim Duncan") OVER serve YIELD serve._dst; """ Then the result should be, in any order: | serve._dst | When executing query: """ - GO 10 STEPS FROM hash("Tim Duncan") OVER serve; + GO 10 STEPS FROM hash("Tim Duncan") OVER serve YIELD serve._dst; """ Then the result should be, in any order: | serve._dst | When executing query: """ - GO 10000000000000 STEPS FROM hash("Tim Duncan") OVER serve; + GO 10000000000000 STEPS FROM hash("Tim Duncan") OVER serve YIELD serve._dst; """ Then the result should be, in any order: | serve._dst | When executing query: """ - GO 1 TO 10 STEPS FROM hash("Tim Duncan") OVER serve; + GO 1 TO 10 STEPS FROM hash("Tim Duncan") OVER serve YIELD serve._dst; """ Then the result should be, in any order, and the columns 0 should be hashed: | serve._dst | | "Spurs" | When executing query: """ - GO 2 TO 10 STEPS FROM hash("Tim Duncan") OVER serve; + GO 2 TO 10 STEPS FROM hash("Tim Duncan") OVER serve YIELD serve._dst; """ Then the result should be, in any order, and the columns 0 should be hashed: | serve._dst | When executing query: """ - GO 10000000000 TO 10000000002 STEPS FROM hash("Tim Duncan") OVER serve; + GO 10000000000 TO 10000000002 STEPS FROM hash("Tim Duncan") OVER serve YIELD serve._dst; """ Then the result should be, in any order: | serve._dst | diff --git a/tests/tck/features/go/GO.feature b/tests/tck/features/go/GO.feature index 7eef941ae94..463caed3579 100644 --- a/tests/tck/features/go/GO.feature +++ b/tests/tck/features/go/GO.feature @@ -10,19 +10,19 @@ Feature: Go Sentence Scenario: one step When executing query: """ - GO FROM "Tim Duncan" OVER serve + GO FROM "Tim Duncan" OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | | "Spurs" | When executing query: """ - GO FROM "Tim Duncan", "Tony Parker" OVER like WHERE $$.player.age > 9223372036854775807+1 + GO FROM "Tim Duncan", "Tony Parker" OVER like WHERE $$.player.age > 9223372036854775807+1 YIELD like._dst """ Then a ExecutionError should be raised at runtime: result of (9223372036854775807+1) cannot be represented as an integer When executing query: """ - GO FROM "Tim Duncan", "Tony Parker" OVER like WHERE $$.player.age > -9223372036854775808-1 + GO FROM "Tim Duncan", "Tony Parker" OVER like WHERE $$.player.age > -9223372036854775808-1 YIELD like._dst """ Then a ExecutionError should be raised at runtime: result of (-9223372036854775808-1) cannot be represented as an integer When executing query: @@ -46,7 +46,7 @@ Feature: Go Sentence | "Tony Parker" | 36 | When executing query: """ - GO FROM "Tim Duncan", "Tim Duncan" OVER serve + GO FROM "Tim Duncan", "Tim Duncan" OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -54,7 +54,7 @@ Feature: Go Sentence | "Spurs" | When executing query: """ - YIELD "Tim Duncan" as vid | GO FROM $-.vid OVER serve + YIELD "Tim Duncan" as vid | GO FROM $-.vid OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -83,8 +83,9 @@ Feature: Go Sentence | "Rajon Rondo" | 2017 | 2018 | "Pelicans" | When executing query: """ - GO FROM "Boris Diaw" OVER like YIELD like._dst as id - | GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve + GO FROM "Boris Diaw" OVER like YIELD like._dst as id | + GO FROM $-.id OVER like YIELD like._dst as id | + GO FROM $-.id OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -97,7 +98,7 @@ Feature: Go Sentence | "Trail Blazers" | When executing query: """ - GO FROM 'Thunders' OVER serve REVERSELY + GO FROM 'Thunders' OVER serve REVERSELY YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -110,7 +111,7 @@ Feature: Go Sentence When executing query: """ GO FROM "Boris Diaw" OVER like YIELD like._dst as id - |(GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve) + |(GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve YIELD serve._dst) """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -124,14 +125,14 @@ Feature: Go Sentence When executing query: """ GO FROM "No Exist Vertex Id" OVER like YIELD like._dst as id - |(GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve) + |(GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve YIELD serve._dst) """ Then the result should be, in any order, with relax comparison: | serve._dst | When executing query: """ GO FROM "Boris Diaw" OVER like, serve YIELD like._dst as id - |(GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve) + |(GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve YIELD serve._dst) """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -162,7 +163,7 @@ Feature: Go Sentence Scenario: assignment simple When executing query: """ - $var = GO FROM "Tracy McGrady" OVER like YIELD like._dst as id; GO FROM $var.id OVER like + $var = GO FROM "Tracy McGrady" OVER like YIELD like._dst as id; GO FROM $var.id OVER like YIELD like._dst """ Then the result should be, in any order, with relax comparison: | like._dst | @@ -173,7 +174,7 @@ Feature: Go Sentence When executing query: """ $var = (GO FROM "Tracy McGrady" OVER like YIELD like._dst as id | GO FROM $-.id OVER like YIELD like._dst as id); - GO FROM $var.id OVER like + GO FROM $var.id OVER like YIELD like._dst """ Then the result should be, in any order, with relax comparison: | like._dst | @@ -206,7 +207,7 @@ Feature: Go Sentence Scenario: assignment empty result When executing query: """ - $var = GO FROM "-1" OVER like YIELD like._dst as id; GO FROM $var.id OVER like + $var = GO FROM "-1" OVER like YIELD like._dst as id; GO FROM $var.id OVER like YIELD like._dst """ Then the result should be, in any order, with relax comparison: | like._dst | @@ -214,7 +215,7 @@ Feature: Go Sentence Scenario: variable undefined When executing query: """ - GO FROM $var OVER like + GO FROM $var OVER like YIELD like._dst """ Then a SyntaxError should be raised at runtime: syntax error near `OVER' @@ -250,7 +251,7 @@ Feature: Go Sentence Scenario: vertex noexist When executing query: """ - GO FROM "NON EXIST VERTEX ID" OVER serve + GO FROM "NON EXIST VERTEX ID" OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -272,7 +273,7 @@ Feature: Go Sentence """ GO FROM "NON EXIST VERTEX ID" OVER like YIELD like._dst as id | GO FROM $-.id OVER like YIELD like._dst as id - | GO FROM $-.id OVER serve + | GO FROM $-.id OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -280,7 +281,7 @@ Feature: Go Sentence """ GO FROM "NON EXIST VERTEX ID" OVER serve YIELD serve._dst as id, serve.start_year as start | YIELD $-.id as id WHERE $-.start > 20000 - | Go FROM $-.id over serve + | Go FROM $-.id over serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -306,7 +307,7 @@ Feature: Go Sentence | EMPTY | "Russell Westbrook" | When executing query: """ - GO FROM "Russell Westbrook" OVER * REVERSELY + GO FROM "Russell Westbrook" OVER * REVERSELY YIELD like._dst, serve._dst, teammate._dst """ Then the result should be, in any order, with relax comparison: | like._dst | serve._dst | teammate._dst | @@ -325,7 +326,7 @@ Feature: Go Sentence | EMPTY | "Dwyane Wade" | When executing query: """ - GO FROM "Paul Gasol" OVER * + GO FROM "Paul Gasol" OVER * YIELD like._dst, serve._dst, teammate._dst """ Then the result should be, in any order, with relax comparison: | like._dst | serve._dst | teammate._dst | @@ -384,7 +385,7 @@ Feature: Go Sentence When executing query: """ GO FROM "Boris Diaw" OVER * YIELD like._dst as id - | ( GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve ) + | ( GO FROM $-.id OVER like YIELD like._dst as id | GO FROM $-.id OVER serve YIELD serve._dst) """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -425,7 +426,7 @@ Feature: Go Sentence | EMPTY | 90 | When executing query: """ - GO FROM "Shaquile O\'Neal" OVER serve, like + GO FROM "Shaquile O\'Neal" OVER serve, like YIELD serve._dst, like._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | like._dst | @@ -439,7 +440,7 @@ Feature: Go Sentence | EMPTY | "Tim Duncan" | When executing query: """ - GO FROM 'Russell Westbrook' OVER serve, like + GO FROM 'Russell Westbrook' OVER serve, like YIELD serve._dst, like._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | like._dst | @@ -467,7 +468,7 @@ Feature: Go Sentence | EMPTY | "Russell Westbrook" | When executing query: """ - GO FROM "Russell Westbrook" OVER serve, like REVERSELY + GO FROM "Russell Westbrook" OVER serve, like REVERSELY YIELD serve._dst, like._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | like._dst | @@ -663,7 +664,7 @@ Feature: Go Sentence When executing query: """ GO FROM 'Tim Duncan' OVER like YIELD like._dst AS id | - GO FROM $-.id OVER serve WHERE $-.id IN ['Tony Parker', 123] + GO FROM $-.id OVER serve WHERE $-.id IN ['Tony Parker', 123] YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -672,7 +673,7 @@ Feature: Go Sentence When executing query: """ GO FROM 'Tim Duncan' OVER like YIELD like._dst AS id | - GO FROM $-.id OVER serve WHERE $-.id IN ['Tony Parker', 123] AND 1 == 1 + GO FROM $-.id OVER serve WHERE $-.id IN ['Tony Parker', 123] AND 1 == 1 YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -686,7 +687,7 @@ Feature: Go Sentence $A = GO FROM 'Tim Duncan' OVER like YIELD like._dst AS dst; $rA = YIELD $A.* WHERE $A.dst == 123; RETURN $rA IF $rA IS NOT NULL; - GO FROM $A.dst OVER serve + GO FROM $A.dst OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -698,7 +699,7 @@ Feature: Go Sentence $A = GO FROM 'Tim Duncan' OVER like YIELD like._dst AS dst; $rA = YIELD $A.* WHERE 1 == 1; RETURN $rA IF $rA IS NOT NULL; - GO FROM $A.dst OVER serve + GO FROM $A.dst OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -712,7 +713,7 @@ Feature: Go Sentence $B = GO FROM $A.dstA OVER like YIELD like._dst AS dstB; $rB = YIELD $B.* WHERE $B.dstB == 456; RETURN $rB IF $rB IS NOT NULL; - GO FROM $B.dstB OVER serve + GO FROM $B.dstB OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -880,7 +881,7 @@ Feature: Go Sentence When executing query: """ GO FROM 'Manu Ginobili' OVER * REVERSELY YIELD like._dst AS id - | GO FROM $-.id OVER serve + | GO FROM $-.id OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -957,7 +958,7 @@ Feature: Go Sentence When executing query: """ GO FROM 'Manu Ginobili' OVER like REVERSELY YIELD like._dst AS id - | GO FROM $-.id OVER serve + | GO FROM $-.id OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -972,14 +973,14 @@ Feature: Go Sentence Scenario: bidirect When executing query: """ - GO FROM 'Tim Duncan' OVER serve bidirect + GO FROM 'Tim Duncan' OVER serve bidirect YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | | "Spurs" | When executing query: """ - GO FROM 'Tim Duncan' OVER like bidirect + GO FROM 'Tim Duncan' OVER like bidirect YIELD like._dst """ Then the result should be, in any order, with relax comparison: | like._dst | @@ -997,7 +998,7 @@ Feature: Go Sentence | "Shaquile O'Neal" | When executing query: """ - GO FROM 'Tim Duncan' OVER serve, like bidirect + GO FROM 'Tim Duncan' OVER serve, like bidirect YIELD serve._dst, like._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | like._dst | @@ -1079,7 +1080,7 @@ Feature: Go Sentence | "Tim Duncan" | EMPTY | EMPTY | EMPTY | "Manu Ginobili" | When executing query: """ - GO FROM 'Tim Duncan' OVER * bidirect + GO FROM 'Tim Duncan' OVER * bidirect YIELD like._dst, serve._dst, teammate._dst """ Then the result should be, in any order, with relax comparison: | like._dst | serve._dst | teammate._dst | @@ -1114,27 +1115,27 @@ Feature: Go Sentence When executing query: """ GO FROM 'Tim Duncan' OVER like YIELD like._dst AS id, like.likeness AS id - | GO FROM $-.id OVER serve + | GO FROM $-.id OVER serve YIELD serve._dst """ Then a SemanticError should be raised at runtime: Duplicate Column Name : `id' When executing query: """ GO FROM 'Tim Duncan' OVER like, serve YIELD serve.start_year AS year, serve.end_year AS year, serve._dst AS id - | GO FROM $-.id OVER * + | GO FROM $-.id OVER * YIELD like._dst """ Then a SemanticError should be raised at runtime: Duplicate Column Name : `year' When executing query: """ $a = GO FROM 'Tim Duncan' OVER * YIELD serve.start_year AS year, serve.end_year AS year, serve._dst AS id; - | GO FROM $-.id OVER serve + | GO FROM $-.id OVER serve YIELD serve._dst """ Then a SyntaxError should be raised at runtime: syntax error near `| GO FRO' Scenario: invalid condition in where When executing query: """ - GO FROM 'Tim Duncan' OVER like where like.likeness + GO FROM 'Tim Duncan' OVER like where like.likeness YIELD like._dst """ Then a SemanticError should be raised at runtime: `like.likeness', expected boolean, but was `INT' @@ -1237,14 +1238,14 @@ Feature: Go Sentence | "Tim Duncan" | 90 | "Tim Duncan" | When executing query: """ - GO 0 TO 3 STEPS FROM 'Tim Duncan' OVER serve + GO 0 TO 3 STEPS FROM 'Tim Duncan' OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | | "Spurs" | When executing query: """ - GO 2 TO 3 STEPS FROM 'Tim Duncan' OVER serve + GO 2 TO 3 STEPS FROM 'Tim Duncan' OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -1306,7 +1307,7 @@ Feature: Go Sentence | "Damian Lillard" | When executing query: """ - GO 1 TO 3 STEPS FROM 'Spurs' OVER serve REVERSELY + GO 1 TO 3 STEPS FROM 'Spurs' OVER serve REVERSELY YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -1330,7 +1331,7 @@ Feature: Go Sentence | "Marco Belinelli" | When executing query: """ - GO 0 TO 3 STEPS FROM 'Spurs' OVER serve REVERSELY + GO 0 TO 3 STEPS FROM 'Spurs' OVER serve REVERSELY YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -1542,19 +1543,19 @@ Feature: Go Sentence Scenario: zero step When executing query: """ - GO 0 STEPS FROM 'Tim Duncan' OVER serve BIDIRECT + GO 0 STEPS FROM 'Tim Duncan' OVER serve BIDIRECT YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | When executing query: """ - GO 0 STEPS FROM 'Tim Duncan' OVER serve + GO 0 STEPS FROM 'Tim Duncan' OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | When executing query: """ - GO 0 STEPS FROM 'Tim Duncan' OVER like YIELD like._dst as id | GO FROM $-.id OVER serve + GO 0 STEPS FROM 'Tim Duncan' OVER like YIELD like._dst as id | GO FROM $-.id OVER serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -1726,7 +1727,7 @@ Feature: Go Sentence Scenario: Bugfix filter not pushdown When executing query: """ - GO FROM "Tim Duncan" OVER like WHERE like._dst == "Tony Parker" | limit 10; + GO FROM "Tim Duncan" OVER like WHERE like._dst == "Tony Parker" YIELD like._dst | limit 10; """ Then the result should be, in any order, with relax comparison: | like._dst | @@ -1735,38 +1736,38 @@ Feature: Go Sentence Scenario: Step over end When executing query: """ - GO 2 STEPS FROM "Tim Duncan" OVER serve; + GO 2 STEPS FROM "Tim Duncan" OVER serve YIELD serve._dst; """ Then the result should be, in any order: | serve._dst | When executing query: """ - GO 10 STEPS FROM "Tim Duncan" OVER serve; + GO 10 STEPS FROM "Tim Duncan" OVER serve YIELD serve._dst; """ Then the result should be, in any order: | serve._dst | When executing query: """ - GO 10000000000000 STEPS FROM "Tim Duncan" OVER serve; + GO 10000000000000 STEPS FROM "Tim Duncan" OVER serve YIELD serve._dst; """ Then the result should be, in any order: | serve._dst | When executing query: """ - GO 1 TO 10 STEPS FROM "Tim Duncan" OVER serve; + GO 1 TO 10 STEPS FROM "Tim Duncan" OVER serve YIELD serve._dst; """ Then the result should be, in any order: | serve._dst | | "Spurs" | When executing query: """ - GO 2 TO 10 STEPS FROM "Tim Duncan" OVER serve; + GO 2 TO 10 STEPS FROM "Tim Duncan" OVER serve YIELD serve._dst; """ Then the result should be, in any order: | serve._dst | When executing query: """ - GO 1000000000 TO 1000000002 STEPS FROM "Tim Duncan" OVER serve; + GO 1000000000 TO 1000000002 STEPS FROM "Tim Duncan" OVER serve YIELD serve._dst; """ Then the result should be, in any order: | serve._dst | @@ -1775,28 +1776,28 @@ Feature: Go Sentence Scenario: go step limit When executing query: """ - GO FROM "Tim Duncan" OVER like LIMIT [10,10]; + GO FROM "Tim Duncan" OVER like LIMIT [10,10] YIELD like._dst; """ Then a SemanticError should be raised at runtime: When executing query: """ - GO FROM "Tim Duncan" OVER like LIMIT ["10"]; + GO FROM "Tim Duncan" OVER like LIMIT ["10"] YIELD like._dst; """ Then a SemanticError should be raised at runtime: When executing query: """ - GO FROM "Tim Duncan" OVER like LIMIT [a]; + GO FROM "Tim Duncan" OVER like LIMIT [a] YIELD like._dst; """ Then a SemanticError should be raised at runtime: When executing query: """ - GO FROM "Tim Duncan" OVER like LIMIT [1]; + GO FROM "Tim Duncan" OVER like LIMIT [1] YIELD like._dst; """ Then the result should be, in any order, with relax comparison: | like._dst | When executing query: """ - GO 3 STEPS FROM "Tim Duncan" OVER like LIMIT [1, 2, 2]; + GO 3 STEPS FROM "Tim Duncan" OVER like LIMIT [1, 2, 2] YIELD like._dst; """ Then the result should be, in any order, with relax comparison: | like._dst | @@ -1816,51 +1817,6 @@ Feature: Go Sentence Then the result should be, in any order, with relax comparison: | like._dst | - @skip - Scenario: go step sample - When executing query: - """ - GO FROM "Tim Duncan" OVER like SAMPLE [10,10]; - """ - Then a SemanticError should be raised at runtime: - When executing query: - """ - GO FROM "Tim Duncan" OVER like SAMPLE ["10"]; - """ - Then a SemanticError should be raised at runtime: - When executing query: - """ - GO FROM "Tim Duncan" OVER like SAMPLE [a]; - """ - Then a SemanticError should be raised at runtime: - When executing query: - """ - GO FROM "Tim Duncan" OVER like SAMPLE [1]; - """ - Then the result should be, in any order, with relax comparison: - | like._dst | - When executing query: - """ - GO 3 STEPS FROM "Tim Duncan" OVER like SAMPLE [1, 3, 2]; - """ - Then the result should be, in any order, with relax comparison: - | like._dst | - - @skip - Scenario: go step filter & step sample - When executing query: - """ - GO FROM "Tim Duncan" OVER like WHERE [like._dst == "Tony Parker"] SAMPLE [1]; - """ - Then the result should be, in any order, with relax comparison: - | like._dst | - When executing query: - """ - GO 3 STEPS FROM "Tim Duncan" OVER like WHERE [like._dst == "Tony Parker", $$.player.age>20, $$.player.age>22] SAMPLE [1, 2, 2]; - """ - Then the result should be, in any order, with relax comparison: - | like._dst | - Scenario: with no existed tag When executing query: """ diff --git a/tests/tck/features/go/GoYieldVertexEdge.feature b/tests/tck/features/go/GoYieldVertexEdge.feature index 92d920a6650..9fcbdd4a0bc 100644 --- a/tests/tck/features/go/GoYieldVertexEdge.feature +++ b/tests/tck/features/go/GoYieldVertexEdge.feature @@ -1734,28 +1734,28 @@ Feature: Go Yield Vertex And Edge Sentence Scenario: go step sample When executing query: """ - GO FROM "Tim Duncan" OVER like SAMPLE [10,10]; + GO FROM "Tim Duncan" OVER like YIELD like._dst SAMPLE [10,10]; """ Then a SemanticError should be raised at runtime: When executing query: """ - GO FROM "Tim Duncan" OVER like SAMPLE ["10"]; + GO FROM "Tim Duncan" OVER like YIELD like._dst SAMPLE ["10"]; """ Then a SemanticError should be raised at runtime: When executing query: """ - GO FROM "Tim Duncan" OVER like SAMPLE [a]; + GO FROM "Tim Duncan" OVER like YIELD like._dst SAMPLE [a]; """ Then a SemanticError should be raised at runtime: When executing query: """ - GO FROM "Tim Duncan" OVER like SAMPLE [1]; + GO FROM "Tim Duncan" OVER like YIELD like._dst SAMPLE [1]; """ Then the result should be, in any order, with relax comparison: | like._dst | When executing query: """ - GO 3 STEPS FROM "Tim Duncan" OVER like SAMPLE [1, 3, 2]; + GO 3 STEPS FROM "Tim Duncan" OVER like YIELD like._dst SAMPLE [1, 3, 2]; """ Then the result should be, in any order, with relax comparison: | like._dst | @@ -1764,13 +1764,13 @@ Feature: Go Yield Vertex And Edge Sentence Scenario: go step filter & step sample When executing query: """ - GO FROM "Tim Duncan" OVER like WHERE [like._dst == "Tony Parker"] SAMPLE [1]; + GO FROM "Tim Duncan" OVER like WHERE [like._dst == "Tony Parker"] YIELD like._dst SAMPLE [1]; """ Then the result should be, in any order, with relax comparison: | like._dst | When executing query: """ - GO 3 STEPS FROM "Tim Duncan" OVER like WHERE [like._dst == "Tony Parker", $$.player.age>20, $$.player.age>22] SAMPLE [1, 2, 2]; + GO 3 STEPS FROM "Tim Duncan" OVER like WHERE [like._dst == "Tony Parker", $$.player.age>20, $$.player.age>22] YIELD like._dst SAMPLE [1, 2, 2]; """ Then the result should be, in any order, with relax comparison: | like._dst | diff --git a/tests/tck/features/go/GroupbyLimit.feature b/tests/tck/features/go/GroupbyLimit.feature index 7fdc010599a..2a282a2b7b0 100644 --- a/tests/tck/features/go/GroupbyLimit.feature +++ b/tests/tck/features/go/GroupbyLimit.feature @@ -6,7 +6,7 @@ Feature: Groupby & limit Sentence Scenario: Syntax test1 When executing query: """ - GO FROM 1 OVER server | LIMIT 1, -2 + GO FROM 1 OVER server YIELD server._dst | LIMIT 1, -2 """ Then a SyntaxError should be raised at runtime: diff --git a/tests/tck/features/go/Orderby.feature b/tests/tck/features/go/Orderby.feature index 989407486a6..a723ff3ac1d 100644 --- a/tests/tck/features/go/Orderby.feature +++ b/tests/tck/features/go/Orderby.feature @@ -162,7 +162,7 @@ Feature: Orderby Sentence Scenario: Pipe output of ORDER BY to graph traversal When executing query: """ - GO FROM "Boris Diaw" OVER like YIELD like._dst as id | ORDER BY $-.id | GO FROM $-.id over serve + GO FROM "Boris Diaw" OVER like YIELD like._dst as id | ORDER BY $-.id | GO FROM $-.id over serve YIELD serve._dst """ Then the result should be, in any order, with relax comparison: | serve._dst | @@ -191,10 +191,10 @@ Feature: Orderby Sentence | "LaMarcus Aldridge" | 90 | When executing query: """ - $var = GO FROM "Tony Parker" OVER like YIELD like._dst AS dst; ORDER BY $var.dst DESC | FETCH PROP ON * $-.dst + $var = GO FROM "Tony Parker" OVER like YIELD like._dst AS dst; ORDER BY $var.dst DESC | FETCH PROP ON * $-.dst YIELD vertex as node """ Then the result should be, in order, with relax comparison: - | vertices_ | + | node | | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | | ("LaMarcus Aldridge" :player{age: 33, name: "LaMarcus Aldridge"}) | diff --git a/tests/tck/features/go/SampleLimit.feature b/tests/tck/features/go/SampleLimit.feature index 6915de1c33b..1a6477a4509 100644 --- a/tests/tck/features/go/SampleLimit.feature +++ b/tests/tck/features/go/SampleLimit.feature @@ -10,34 +10,34 @@ Feature: Sample and limit Scenario: Sample Limit Go in One step When executing query: """ - GO FROM 'Tim Duncan' OVER like LIMIT [-1] + GO FROM 'Tim Duncan' OVER like YIELD edge as e LIMIT [-1] """ Then a SemanticError should be raised at runtime: Limit/Sample element must be nonnegative. When executing query: """ - GO FROM 'Tim Duncan' OVER like LIMIT [1, 2] + GO FROM 'Tim Duncan' OVER like YIELD $$ as dst LIMIT [1, 2] """ Then a SemanticError should be raised at runtime: `[1,2]' length must be equal to GO step size 1. When executing query: """ - GO FROM 'Tim Duncan' OVER like LIMIT ["1"] + GO FROM 'Tim Duncan' OVER like YIELD $$ as dst LIMIT ["1"] """ Then a SemanticError should be raised at runtime: Limit/Sample element type must be Integer. When executing query: """ - GO FROM 'Tim Duncan' OVER like SAMPLE ["1"] + GO FROM 'Tim Duncan' OVER like YIELD edge as e SAMPLE ["1"] """ Then a SemanticError should be raised at runtime: Limit/Sample element type must be Integer. When executing query: """ - GO FROM 'Tim Duncan' OVER like LIMIT [1] + GO FROM 'Tim Duncan' OVER like YIELD like._dst LIMIT [1] """ Then the result should be, in any order: | like._dst | | 'Manu Ginobili' | When executing query: """ - GO FROM 'Tim Duncan' OVER like LIMIT [3] + GO FROM 'Tim Duncan' OVER like YIELD like._dst LIMIT [3] """ Then the result should be, in any order: | like._dst | @@ -45,14 +45,14 @@ Feature: Sample and limit | 'Tony Parker' | When executing query: """ - GO FROM 'Tim Duncan' OVER like SAMPLE [1] + GO FROM 'Tim Duncan' OVER like YIELD like._dst SAMPLE [1] """ Then the result should be, in any order: | like._dst | | /[\s\w+]/ | When executing query: """ - GO FROM 'Tim Duncan' OVER like SAMPLE [3] + GO FROM 'Tim Duncan' OVER like YIELD like._dst SAMPLE [3] """ Then the result should be, in any order: | like._dst | @@ -62,12 +62,12 @@ Feature: Sample and limit Scenario: Sample Limit Go in Multiple steps When executing query: """ - GO 3 STEPS FROM 'Tim Duncan' OVER like LIMIT [1, 2] + GO 3 STEPS FROM 'Tim Duncan' OVER like YIELD like._dst LIMIT [1, 2] """ Then a SemanticError should be raised at runtime: `[1,2]' length must be equal to GO step size 3. When executing query: """ - GO 3 STEPS FROM 'Tim Duncan' OVER like LIMIT [1, 2, 3] + GO 3 STEPS FROM 'Tim Duncan' OVER like YIELD like._dst LIMIT [1, 2, 3] """ Then the result should be, in any order: | like._dst | diff --git a/tests/tck/features/go/SampleLimit.intVid.feature b/tests/tck/features/go/SampleLimit.intVid.feature index 0df8135c0cf..5f11aa182df 100644 --- a/tests/tck/features/go/SampleLimit.intVid.feature +++ b/tests/tck/features/go/SampleLimit.intVid.feature @@ -10,24 +10,24 @@ Feature: Sample and limit Scenario: Sample Limit Go in One step When executing query: """ - GO FROM hash('Tim Duncan') OVER like LIMIT [-1] + GO FROM hash('Tim Duncan') OVER like YIELD edge as e LIMIT [-1] """ Then a SemanticError should be raised at runtime: Limit/Sample element must be nonnegative. When executing query: """ - GO FROM hash('Tim Duncan') OVER like LIMIT [1, 2] + GO FROM hash('Tim Duncan') OVER like YIELD $$ as dst LIMIT [1, 2] """ Then a SemanticError should be raised at runtime: `[1,2]' length must be equal to GO step size 1 When executing query: """ - GO FROM hash('Tim Duncan') OVER like LIMIT [1] + GO FROM hash('Tim Duncan') OVER like YIELD like._dst LIMIT [1] """ Then the result should be, in any order: | like._dst | | hash('Manu Ginobili') | When executing query: """ - GO FROM hash('Tim Duncan') OVER like LIMIT [3] + GO FROM hash('Tim Duncan') OVER like YIELD like._dst LIMIT [3] """ Then the result should be, in any order: | like._dst | @@ -35,14 +35,14 @@ Feature: Sample and limit | hash('Tony Parker') | When executing query: """ - GO FROM hash('Tim Duncan') OVER like SAMPLE [1] + GO FROM hash('Tim Duncan') OVER like YIELD like._dst SAMPLE [1] """ Then the result should be, in any order: | like._dst | | /[\d\-+]/ | When executing query: """ - GO FROM hash('Tim Duncan') OVER like SAMPLE [3] + GO FROM hash('Tim Duncan') OVER like YIELD like._dst SAMPLE [3] """ Then the result should be, in any order: | like._dst | @@ -52,12 +52,12 @@ Feature: Sample and limit Scenario: Sample Limit Go in Multiple steps When executing query: """ - GO 3 STEPS FROM hash('Tim Duncan') OVER like LIMIT [1, 2] + GO 3 STEPS FROM hash('Tim Duncan') OVER like YIELD like._dst LIMIT [1, 2] """ Then a SemanticError should be raised at runtime: `[1,2]' length must be equal to GO step size 3 When executing query: """ - GO 3 STEPS FROM hash('Tim Duncan') OVER like LIMIT [1, 2, 3] + GO 3 STEPS FROM hash('Tim Duncan') OVER like YIELD like._dst LIMIT [1, 2, 3] """ Then the result should be, in any order: | like._dst | diff --git a/tests/tck/features/insert/Insert.IntVid.feature b/tests/tck/features/insert/Insert.IntVid.feature index 2ae02c68c5f..cce5e9628e7 100644 --- a/tests/tck/features/insert/Insert.IntVid.feature +++ b/tests/tck/features/insert/Insert.IntVid.feature @@ -66,9 +66,9 @@ Feature: Insert int vid of vertex and edge """ FETCH PROP ON * hash("Tom") YIELD person.name, person.age, interest.name """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | person.name | person.age | interest.name | - | "Tom" | "Tom" | 18 | "basketball" | + Then the result should be, in any order: + | person.name | person.age | interest.name | + | "Tom" | 18 | "basketball" | # insert vertex wrong type value When executing query: """ @@ -139,9 +139,9 @@ Feature: Insert int vid of vertex and edge """ FETCH PROP ON person hash("Conan") YIELD person.name, person.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | person.name | person.age | - | 'Conan' | "Conan" | 10 | + Then the result should be, in any order: + | person.name | person.age | + | "Conan" | 10 | # # insert vertex with uuid # When executing query: # """ @@ -171,9 +171,9 @@ Feature: Insert int vid of vertex and edge """ FETCH PROP ON schoolmate hash("Tom")->hash("Bob") YIELD schoolmate.likeness, schoolmate.nickname """ - Then the result should be, in any order, and the columns 0,1 should be hashed: - | schoolmate._src | schoolmate._dst | schoolmate._rank | schoolmate.likeness | schoolmate.nickname | - | 'Tom' | 'Bob' | 0 | 87 | "Superman" | + Then the result should be, in any order: + | schoolmate.likeness | schoolmate.nickname | + | 87 | "Superman" | # insert edge with timestamp succeed When try to execute query: """ @@ -197,9 +197,9 @@ Feature: Insert int vid of vertex and edge """ FETCH PROP ON school hash("sun_school") YIELD school.name, school.create_time """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | school.name | school.create_time | - | "sun_school" | "sun_school" | 1262340000 | + Then the result should be, in any order: + | school.name | school.create_time | + | "sun_school" | 1262340000 | # insert one vertex multi tags When executing query: """ @@ -219,17 +219,17 @@ Feature: Insert int vid of vertex and edge """ FETCH PROP ON person hash("Bob") YIELD person.name, person.age """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | person.name | person.age | - | 'Bob' | 'Bob' | 9 | + Then the result should be, in any order: + | person.name | person.age | + | 'Bob' | 9 | # check student tag result with fetch When executing query: """ FETCH PROP ON student hash("Bob") YIELD student.grade, student.number """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | student.grade | student.number | - | 'Bob' | 'four' | 20191106001 | + Then the result should be, in any order: + | student.grade | student.number | + | 'four' | 20191106001 | # insert multi vertex multi tags When executing query: """ diff --git a/tests/tck/features/insert/Insert.feature b/tests/tck/features/insert/Insert.feature index feaa9ecbf8b..8b2fc11c6d5 100644 --- a/tests/tck/features/insert/Insert.feature +++ b/tests/tck/features/insert/Insert.feature @@ -67,10 +67,10 @@ Feature: Insert string vid of vertex and edge Then the execution should be successful When executing query: """ - FETCH PROP ON * "Tom" + FETCH PROP ON * "Tom" YIELD vertex as node """ Then the result should be, in any order, with relax comparison: - | vertices_ | + | node | | ("Tom":person{name:"Tom", age:18}:interest{name:"basketball"}) | # insert vertex wrong type value When executing query: @@ -144,10 +144,10 @@ Feature: Insert string vid of vertex and edge # check vertex result with fetch When executing query: """ - FETCH PROP ON person "Conan" + FETCH PROP ON person "Conan" YIELD vertex as node """ Then the result should be, in any order, with relax comparison: - | vertices_ | + | node | | ('Conan') | # insert vertex with string timestamp succeeded When try to execute query: @@ -167,8 +167,8 @@ Feature: Insert string vid of vertex and edge FETCH PROP ON schoolmate "Tom"->"Bob" YIELD schoolmate.likeness, schoolmate.nickname """ Then the result should be, in any order: - | schoolmate._src | schoolmate._dst | schoolmate._rank | schoolmate.likeness | schoolmate.nickname | - | 'Tom' | 'Bob' | 0 | 87 | 'Superman' | + | schoolmate.likeness | schoolmate.nickname | + | 87 | 'Superman' | # check edge result with go When executing query: """ @@ -184,8 +184,8 @@ Feature: Insert string vid of vertex and edge FETCH PROP ON school "sun_school" YIELD school.name, school.create_time """ Then the result should be, in any order: - | VertexID | school.name | school.create_time | - | "sun_school" | "sun_school" | 1262340000 | + | school.name | school.create_time | + | "sun_school" | 1262340000 | # insert one vertex multi tags When executing query: """ @@ -204,16 +204,16 @@ Feature: Insert string vid of vertex and edge FETCH PROP ON person "Bob" YIELD person.name, person.age """ Then the result should be, in any order: - | VertexID | person.name | person.age | - | 'Bob' | 'Bob' | 9 | + | person.name | person.age | + | 'Bob' | 9 | # check student tag result with fetch When executing query: """ FETCH PROP ON student "Bob" YIELD student.grade, student.number """ Then the result should be, in any order: - | VertexID | student.grade | student.number | - | 'Bob' | 'four' | 20191106001 | + | student.grade | student.number | + | 'four' | 20191106001 | # insert multi vertex multi tags When executing query: """ @@ -502,10 +502,10 @@ Feature: Insert string vid of vertex and edge # check result When executing query: """ - FETCH PROP ON course "English" + FETCH PROP ON course "English" YIELD vertex as node """ Then the result should be, in any order, with relax comparison: - | vertices_ | + | node | | ('English') | # check result When executing query: @@ -513,8 +513,8 @@ Feature: Insert string vid of vertex and edge FETCH PROP ON student "" YIELD student.name, student.age """ Then the result should be, in any order: - | VertexID | student.name | student.age | - | '' | 'Tom' | 12 | + | student.name | student.age | + | 'Tom' | 12 | # check result When executing query: """ diff --git a/tests/tck/features/insert/InsertIfNotExists.feature b/tests/tck/features/insert/InsertIfNotExists.feature index ca286545ab5..ef4e05689fb 100644 --- a/tests/tck/features/insert/InsertIfNotExists.feature +++ b/tests/tck/features/insert/InsertIfNotExists.feature @@ -38,8 +38,8 @@ Feature: Insert vertex and edge with if not exists FETCH PROP ON person "Conan" YIELD person.age as age """ Then the result should be, in any order, with relax comparison: - | VertexID | age | - | "Conan" | 10 | + | age | + | 10 | # insert vertex if not exists When executing query: """ @@ -51,8 +51,8 @@ Feature: Insert vertex and edge with if not exists FETCH PROP ON person "Conan" YIELD person.age as age """ Then the result should be, in any order, with relax comparison: - | VertexID | age | - | "Conan" | 10 | + | age | + | 10 | # insert same vertex When executing query: """ @@ -64,8 +64,8 @@ Feature: Insert vertex and edge with if not exists FETCH PROP ON person "Conan" YIELD person.age as age """ Then the result should be, in any order, with relax comparison: - | VertexID | age | - | "Conan" | 40 | + | age | + | 40 | # insert edge When try to execute query: """ @@ -78,8 +78,8 @@ Feature: Insert vertex and edge with if not exists FETCH PROP ON like "Tom"->"Conan" YIELD like.likeness """ Then the result should be, in any order: - | like._src | like._dst | like._rank | like.likeness | - | 'Tom' | 'Conan' | 0 | 87 | + | like.likeness | + | 87 | # insert edge if not exists When executing query: """ @@ -92,8 +92,8 @@ Feature: Insert vertex and edge with if not exists FETCH PROP ON like "Tom"->"Conan" YIELD like.likeness """ Then the result should be, in any order: - | like._src | like._dst | like._rank | like.likeness | - | 'Tom' | 'Conan' | 0 | 87 | + | like.likeness | + | 87 | # insert same edge When executing query: """ @@ -106,8 +106,8 @@ Feature: Insert vertex and edge with if not exists FETCH PROP ON like "Tom"->"Conan" YIELD like.likeness """ Then the result should be, in any order: - | like._src | like._dst | like._rank | like.likeness | - | 'Tom' | 'Conan' | 0 | 100 | + | like.likeness | + | 100 | # check result with go When executing query: """ @@ -134,15 +134,15 @@ Feature: Insert vertex and edge with if not exists FETCH PROP ON person "Conan" YIELD person.age as age """ Then the result should be, in any order, with relax comparison: - | VertexID | age | - | "Conan" | 40 | + | age | + | 40 | When executing query: """ FETCH PROP ON student "Conan" YIELD student.number as number """ Then the result should be, in any order, with relax comparison: - | VertexID | number | - | "Conan" | 20180901003 | + | number | + | 20180901003 | # insert multi edges if not exists When executing query: """ @@ -159,15 +159,15 @@ Feature: Insert vertex and edge with if not exists FETCH PROP ON like "Tom"->"Conan" YIELD like.likeness """ Then the result should be, in any order: - | like._src | like._dst | like._rank | like.likeness | - | 'Tom' | 'Conan' | 0 | 100 | + | like.likeness | + | 100 | When executing query: """ FETCH PROP ON like "Tom"->"Peter" YIELD like.likeness """ Then the result should be, in any order: - | like._src | like._dst | like._rank | like.likeness | - | 'Tom' | 'Peter' | 0 | 83 | + | like.likeness | + | 83 | And drop the used space Scenario: insert vertex and edge with default propNames @@ -235,8 +235,8 @@ Feature: Insert vertex and edge with if not exists FETCH PROP ON person "Tom" YIELD person.age as age """ Then the result should be, in any order, with relax comparison: - | VertexID | age | - | "Tom" | 2 | + | age | + | 2 | # check insert edge with default props When try to execute query: """ @@ -274,6 +274,6 @@ Feature: Insert vertex and edge with if not exists FETCH PROP ON like "Tom"->"Conan" YIELD like.likeness """ Then the result should be, in any order: - | like._src | like._dst | like._rank | like.likeness | - | 'Tom' | 'Conan' | 0 | 200 | + | like.likeness | + | 200 | And drop the used space diff --git a/tests/tck/features/lookup/Output.feature b/tests/tck/features/lookup/Output.feature index 1ceae5d2eb6..f0ffe610a0b 100644 --- a/tests/tck/features/lookup/Output.feature +++ b/tests/tck/features/lookup/Output.feature @@ -10,9 +10,9 @@ Feature: Lookup with output FETCH PROP ON player $-.VertexID YIELD player.name """ Then the result should be, in any order: - | VertexID | player.name | - | 'Kobe Bryant' | 'Kobe Bryant' | - | 'Dirk Nowitzki' | 'Dirk Nowitzki' | + | player.name | + | 'Kobe Bryant' | + | 'Dirk Nowitzki' | Scenario: [1] tag ouput with yield rename When executing query: @@ -21,9 +21,9 @@ Feature: Lookup with output FETCH PROP ON player $-.name YIELD player.name AS name """ Then the result should be, in any order: - | VertexID | name | - | 'Kobe Bryant' | 'Kobe Bryant' | - | 'Dirk Nowitzki' | 'Dirk Nowitzki' | + | name | + | 'Kobe Bryant' | + | 'Dirk Nowitzki' | Scenario: [1] tag output by var When executing query: @@ -32,9 +32,9 @@ Feature: Lookup with output FETCH PROP ON player $a.VertexID YIELD player.name """ Then the result should be, in any order: - | VertexID | player.name | - | 'Kobe Bryant' | 'Kobe Bryant' | - | 'Dirk Nowitzki' | 'Dirk Nowitzki' | + | player.name | + | 'Kobe Bryant' | + | 'Dirk Nowitzki' | Scenario: [1] tag ouput with yield rename by var When executing query: @@ -43,9 +43,9 @@ Feature: Lookup with output FETCH PROP ON player $a.name YIELD player.name AS name """ Then the result should be, in any order: - | VertexID | name | - | 'Kobe Bryant' | 'Kobe Bryant' | - | 'Dirk Nowitzki' | 'Dirk Nowitzki' | + | name | + | 'Kobe Bryant' | + | 'Dirk Nowitzki' | Scenario: [2] edge output When executing query: @@ -55,9 +55,9 @@ Feature: Lookup with output FETCH PROP ON serve $-.SrcVID->$-.DstVID YIELD serve.start_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | - | 'Russell Westbrook' | 'Thunders' | 0 | 2008 | - | 'Marc Gasol' | 'Grizzlies' | 0 | 2008 | + | serve.start_year | + | 2008 | + | 2008 | Scenario: [2] edge output with yield rename When executing query: @@ -67,9 +67,9 @@ Feature: Lookup with output FETCH PROP ON serve $-.SrcVID->$-.DstVID YIELD serve.start_year AS startYear """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | startYear | - | 'Russell Westbrook' | 'Thunders' | 0 | 2008 | - | 'Marc Gasol' | 'Grizzlies' | 0 | 2008 | + | startYear | + | 2008 | + | 2008 | Scenario: [2] edge output by var When executing query: @@ -79,9 +79,9 @@ Feature: Lookup with output FETCH PROP ON serve $a.SrcVID->$a.DstVID YIELD serve.start_year """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | serve.start_year | - | 'Russell Westbrook' | 'Thunders' | 0 | 2008 | - | 'Marc Gasol' | 'Grizzlies' | 0 | 2008 | + | serve.start_year | + | 2008 | + | 2008 | Scenario: [2] edge output with yield rename by var When executing query: @@ -91,6 +91,6 @@ Feature: Lookup with output FETCH PROP ON serve $a.SrcVID->$a.DstVID YIELD serve.start_year AS startYear """ Then the result should be, in any order: - | serve._src | serve._dst | serve._rank | startYear | - | 'Russell Westbrook' | 'Thunders' | 0 | 2008 | - | 'Marc Gasol' | 'Grizzlies' | 0 | 2008 | + | startYear | + | 2008 | + | 2008 | diff --git a/tests/tck/features/lookup/Output.intVid.feature b/tests/tck/features/lookup/Output.intVid.feature index a611f033520..b22430945ef 100644 --- a/tests/tck/features/lookup/Output.intVid.feature +++ b/tests/tck/features/lookup/Output.intVid.feature @@ -9,10 +9,10 @@ Feature: Lookup with output in integer vid LOOKUP ON player WHERE player.age == 40 | FETCH PROP ON player $-.VertexID YIELD player.name """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | - | 'Kobe Bryant' | 'Kobe Bryant' | - | 'Dirk Nowitzki' | 'Dirk Nowitzki' | + Then the result should be, in any order: + | player.name | + | 'Kobe Bryant' | + | 'Dirk Nowitzki' | Scenario: [1] tag ouput with yield rename When executing query: @@ -20,10 +20,10 @@ Feature: Lookup with output in integer vid LOOKUP ON player WHERE player.age == 40 YIELD player.name AS name | FETCH PROP ON player $-.VertexID YIELD player.name AS name """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | name | - | 'Kobe Bryant' | 'Kobe Bryant' | - | 'Dirk Nowitzki' | 'Dirk Nowitzki' | + Then the result should be, in any order: + | name | + | 'Kobe Bryant' | + | 'Dirk Nowitzki' | Scenario: [1] tag output by var When executing query: @@ -31,10 +31,10 @@ Feature: Lookup with output in integer vid $a = LOOKUP ON player WHERE player.age == 40; FETCH PROP ON player $a.VertexID YIELD player.name """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | player.name | - | 'Kobe Bryant' | 'Kobe Bryant' | - | 'Dirk Nowitzki' | 'Dirk Nowitzki' | + Then the result should be, in any order: + | player.name | + | 'Kobe Bryant' | + | 'Dirk Nowitzki' | Scenario: [1] tag ouput with yield rename by var When executing query: @@ -42,10 +42,10 @@ Feature: Lookup with output in integer vid $a = LOOKUP ON player WHERE player.age == 40 YIELD player.name AS name; FETCH PROP ON player $a.VertexID YIELD player.name AS name """ - Then the result should be, in any order, and the columns 0 should be hashed: - | VertexID | name | - | 'Kobe Bryant' | 'Kobe Bryant' | - | 'Dirk Nowitzki' | 'Dirk Nowitzki' | + Then the result should be, in any order: + | name | + | 'Kobe Bryant' | + | 'Dirk Nowitzki' | Scenario: [2] edge output When executing query: @@ -54,10 +54,10 @@ Feature: Lookup with output in integer vid YIELD serve.start_year | FETCH PROP ON serve $-.SrcVID->$-.DstVID YIELD serve.start_year """ - Then the result should be, in any order, and the columns 0,1 should be hashed: - | serve._src | serve._dst | serve._rank | serve.start_year | - | 'Russell Westbrook' | 'Thunders' | 0 | 2008 | - | 'Marc Gasol' | 'Grizzlies' | 0 | 2008 | + Then the result should be, in any order: + | serve.start_year | + | 2008 | + | 2008 | Scenario: [2] edge output with yield rename When executing query: @@ -66,10 +66,10 @@ Feature: Lookup with output in integer vid YIELD serve.start_year AS startYear | FETCH PROP ON serve $-.SrcVID->$-.DstVID YIELD serve.start_year AS startYear """ - Then the result should be, in any order, and the columns 0,1 should be hashed: - | serve._src | serve._dst | serve._rank | startYear | - | 'Russell Westbrook' | 'Thunders' | 0 | 2008 | - | 'Marc Gasol' | 'Grizzlies' | 0 | 2008 | + Then the result should be, in any order: + | startYear | + | 2008 | + | 2008 | Scenario: [2] edge output by var When executing query: @@ -78,10 +78,10 @@ Feature: Lookup with output in integer vid YIELD serve.start_year; FETCH PROP ON serve $a.SrcVID->$a.DstVID YIELD serve.start_year """ - Then the result should be, in any order, and the columns 0,1 should be hashed: - | serve._src | serve._dst | serve._rank | serve.start_year | - | 'Russell Westbrook' | 'Thunders' | 0 | 2008 | - | 'Marc Gasol' | 'Grizzlies' | 0 | 2008 | + Then the result should be, in any order: + | serve.start_year | + | 2008 | + | 2008 | Scenario: [2] edge output with yield rename by var When executing query: @@ -90,7 +90,7 @@ Feature: Lookup with output in integer vid YIELD serve.start_year AS startYear; FETCH PROP ON serve $a.SrcVID->$a.DstVID YIELD serve.start_year AS startYear """ - Then the result should be, in any order, and the columns 0,1 should be hashed: - | serve._src | serve._dst | serve._rank | startYear | - | 'Russell Westbrook' | 'Thunders' | 0 | 2008 | - | 'Marc Gasol' | 'Grizzlies' | 0 | 2008 | + Then the result should be, in any order: + | startYear | + | 2008 | + | 2008 | diff --git a/tests/tck/features/mutate/InsertWithTimeType.feature b/tests/tck/features/mutate/InsertWithTimeType.feature index 23bdc90b4b5..f594de96922 100644 --- a/tests/tck/features/mutate/InsertWithTimeType.feature +++ b/tests/tck/features/mutate/InsertWithTimeType.feature @@ -98,15 +98,15 @@ Feature: Insert with time-dependent types FETCH PROP ON tag_date "test" YIELD tag_date.f_date, tag_date.f_time, tag_date.f_datetime; """ Then the result should be, in any order: - | VertexID | tag_date.f_date | tag_date.f_time | tag_date.f_datetime | - | 'test' | '2017-03-04' | '23:01:00.000000' | '2017-03-04T22:30:40.000000' | + | tag_date.f_date | tag_date.f_time | tag_date.f_datetime | + | '2017-03-04' | '23:01:00.000000' | '2017-03-04T22:30:40.000000' | When executing query: """ FETCH PROP ON edge_date "test_src"->"test_dst" YIELD edge_date.f_date, edge_date.f_time, edge_date.f_datetime; """ Then the result should be, in any order: - | edge_date._src | edge_date._dst | edge_date._rank | edge_date.f_date | edge_date.f_time | edge_date.f_datetime | - | 'test_src' | 'test_dst' | 0 | '2017-03-04' | '23:01:00.000000' | '2017-03-04T22:30:40.000000' | + | edge_date.f_date | edge_date.f_time | edge_date.f_datetime | + | '2017-03-04' | '23:01:00.000000' | '2017-03-04T22:30:40.000000' | When executing query: """ UPDATE VERTEX "test" @@ -139,14 +139,14 @@ Feature: Insert with time-dependent types Then the execution should be successful When executing query: """ - FETCH PROP ON tag_date "test"; + FETCH PROP ON tag_date "test" YIELD vertex as node; """ Then the result should be, in any order, with relax comparison: - | vertices_ | + | node | When executing query: """ - FETCH PROP ON edge_date "test_src"->"test_dst"; + FETCH PROP ON edge_date "test_src"->"test_dst" YIELD edge as e; """ Then the result should be, in any order, with relax comparison: - | edges_ | + | e | And drop the used space diff --git a/tests/tck/features/optimizer/PushLimitDownGetNeighborsRule.feature b/tests/tck/features/optimizer/PushLimitDownGetNeighborsRule.feature index bb4264f374b..1258d8b0566 100644 --- a/tests/tck/features/optimizer/PushLimitDownGetNeighborsRule.feature +++ b/tests/tck/features/optimizer/PushLimitDownGetNeighborsRule.feature @@ -10,7 +10,7 @@ Feature: Push Limit down rule Scenario: push limit down to GetNeighbors When profiling query: """ - GO 1 STEPS FROM "James Harden" OVER like REVERSELY | + GO 1 STEPS FROM "James Harden" OVER like REVERSELY YIELD like._dst | Limit 2 """ Then the result should be, in any order: diff --git a/tests/tck/features/optimizer/PushSampleDownRule.feature b/tests/tck/features/optimizer/PushSampleDownRule.feature index c60fb1d1c2a..b6c644757a0 100644 --- a/tests/tck/features/optimizer/PushSampleDownRule.feature +++ b/tests/tck/features/optimizer/PushSampleDownRule.feature @@ -10,7 +10,7 @@ Feature: Push Limit down rule Scenario: push limit down to GetNeighbors When profiling query: """ - GO 1 STEPS FROM "James Harden" OVER like REVERSELY LIMIT [2] + GO 1 STEPS FROM "James Harden" OVER like REVERSELY YIELD like._dst LIMIT [2] """ Then the result should be, in any order: | like._dst | @@ -24,7 +24,7 @@ Feature: Push Limit down rule | 0 | Start | | | When profiling query: """ - GO 2 STEPS FROM "James Harden" OVER like REVERSELY LIMIT [2, 2] + GO 2 STEPS FROM "James Harden" OVER like REVERSELY YIELD like._dst LIMIT [2, 2] """ Then the result should be, in any order: | like._dst | @@ -104,7 +104,7 @@ Feature: Push Limit down rule Scenario: push sample down to GetNeighbors When profiling query: """ - GO 1 STEPS FROM "James Harden" OVER like REVERSELY SAMPLE [2] + GO 1 STEPS FROM "James Harden" OVER like REVERSELY YIELD like._dst SAMPLE [2] """ Then the result should be, in any order: | like._dst | @@ -118,7 +118,7 @@ Feature: Push Limit down rule | 4 | Start | | | When profiling query: """ - GO 2 STEPS FROM "James Harden" OVER like REVERSELY SAMPLE [2, 2] + GO 2 STEPS FROM "James Harden" OVER like REVERSELY YIELD like._dst SAMPLE [2, 2] """ Then the result should be, in any order: | like._dst | diff --git a/tests/tck/features/schema/CreateSpaceAs.feature b/tests/tck/features/schema/CreateSpaceAs.feature index f3e2fb2ce59..4ac06673fcb 100644 --- a/tests/tck/features/schema/CreateSpaceAs.feature +++ b/tests/tck/features/schema/CreateSpaceAs.feature @@ -47,10 +47,10 @@ Feature: Create space as another space # query When executing query: """ - fetch prop on t1 "1"; + fetch prop on t1 "1" YIELD vertex as node; """ Then the result should be, in any order: - | vertices_ | + | node | | ("1" :t1{col1: 1}) | When executing query: """ @@ -61,10 +61,10 @@ Feature: Create space as another space | "1" | When executing query: """ - fetch prop on e1 "1" -> "2"; + fetch prop on e1 "1" -> "2" YIELD edge as e; """ Then the result should be, in any order: - | edges_ | + | e | | [:e1 "1"->"2" @0 {col1: 1}] | When executing query: """ @@ -109,16 +109,16 @@ Feature: Create space as another space # check no data in new space When executing query: """ - fetch prop on t1 "1"; + fetch prop on t1 "1" YIELD vertex as node; """ Then the result should be, in any order: - | vertices_ | + | node | When executing query: """ - fetch prop on e1 "1" -> "2"; + fetch prop on e1 "1" -> "2" YIELD edge as e; """ Then the result should be, in any order: - | edges_ | + | e | # write new data into cloned space When executing query: """ @@ -132,10 +132,10 @@ Feature: Create space as another space # query When executing query: """ - fetch prop on t1 "1"; + fetch prop on t1 "1" YIELD vertex as node; """ Then the result should be, in any order: - | vertices_ | + | node | | ("1" :t1{col1: 2}) | When executing query: """ @@ -146,10 +146,10 @@ Feature: Create space as another space | "1" | When executing query: """ - fetch prop on e1 "1" -> "2"; + fetch prop on e1 "1" -> "2" YIELD edge as e; """ Then the result should be, in any order: - | edges_ | + | e | | [:e1 "1"->"2" @0 {col1: 2}] | When executing query: """ diff --git a/tests/tck/features/schema/Schema.feature b/tests/tck/features/schema/Schema.feature index e960e43c278..868ff77b55d 100644 --- a/tests/tck/features/schema/Schema.feature +++ b/tests/tck/features/schema/Schema.feature @@ -510,8 +510,8 @@ Feature: Insert string vid of vertex and edge FETCH PROP ON t "1" YIELD t.name, t.age, t.description """ Then the result should be, in any order: - | VertexID | t.name | t.age | t.description | - | "1" | "N/A" | -1 | "none" | + | t.name | t.age | t.description | + | "N/A" | -1 | "none" | # alter change When executing query: """ @@ -531,8 +531,8 @@ Feature: Insert string vid of vertex and edge FETCH PROP ON t "1" YIELD t.name, t.age, t.description """ Then the result should be, in any order: - | VertexID | t.name | t.age | t.description | - | "1" | "N/A" | -1 | "some one" | + | t.name | t.age | t.description | + | "N/A" | -1 | "some one" | And wait 3 seconds # insert without default prop, failed When executing query: @@ -563,8 +563,8 @@ Feature: Insert string vid of vertex and edge FETCH PROP ON t "1" YIELD t.name, t.age, t.description """ Then the result should be, in any order: - | VertexID | t.name | t.age | t.description | - | "1" | "N/A" | -1 | "some one" | + | t.name | t.age | t.description | + | "N/A" | -1 | "some one" | # alter drop default When executing query: """ diff --git a/tests/tck/features/set/Set.IntVid.feature b/tests/tck/features/set/Set.IntVid.feature index bcf4ce3b9d0..079a98b8427 100644 --- a/tests/tck/features/set/Set.IntVid.feature +++ b/tests/tck/features/set/Set.IntVid.feature @@ -286,7 +286,7 @@ Feature: Integer Vid Set Test When executing query: """ GO FROM 123 OVER like YIELD like._src as src, like._dst as dst - | (GO FROM $-.src OVER serve UNION GO FROM $-.dst OVER serve) + | (GO FROM $-.src OVER serve YIELD serve._dst UNION GO FROM $-.dst OVER serve YIELD serve._dst) """ Then a SemanticError should be raised at runtime: `$-.src', not exist prop `src' diff --git a/tests/tck/features/set/Set.feature b/tests/tck/features/set/Set.feature index 5b99046aadd..80c538fcb12 100644 --- a/tests/tck/features/set/Set.feature +++ b/tests/tck/features/set/Set.feature @@ -292,7 +292,7 @@ Feature: Set Test When executing query: """ GO FROM "123" OVER like YIELD like._src as src, like._dst as dst - | (GO FROM $-.src OVER serve UNION GO FROM $-.dst OVER serve) + | (GO FROM $-.src OVER serve YIELD serve._dst UNION GO FROM $-.dst OVER serve YIELD serve._dst) """ Then a SemanticError should be raised at runtime: `$-.src', not exist prop `src' diff --git a/tests/tck/features/ttl/TTL.feature b/tests/tck/features/ttl/TTL.feature index aebc2ab1b8e..1cb456d209d 100644 --- a/tests/tck/features/ttl/TTL.feature +++ b/tests/tck/features/ttl/TTL.feature @@ -390,76 +390,76 @@ Feature: TTLTest Then the execution should be successful When executing query: """ - FETCH PROP ON person "1"; + FETCH PROP ON person "1" YIELD vertex as node; """ Then the result should be, in any order, with relax comparison: - | vertices_ | + | node | When executing query: """ FETCH PROP ON person "1" YIELD person.id as id """ Then the result should be, in any order: - | VertexID | id | + | id | When executing query: """ FETCH PROP ON * "1" YIELD person.id, career.id """ Then the result should be, in any order: - | VertexID | person.id | career.id | + | person.id | career.id | When executing query: """ FETCH PROP ON person "2" YIELD person.id """ Then the result should be, in any order: - | VertexID | person.id | + | person.id | When executing query: """ FETCH PROP ON person "2" YIELD person.id as id """ Then the result should be, in any order: - | VertexID | id | + | id | When executing query: """ FETCH PROP ON career "2" YIELD career.id; """ Then the result should be, in any order: - | VertexID | career.id | - | "2" | 200 | + | career.id | + | 200 | When executing query: """ FETCH PROP ON * "2" YIELD person.id, career.id """ Then the result should be, in any order: - | VertexID | person.id | career.id | - | "2" | EMPTY | 200 | + | person.id | career.id | + | EMPTY | 200 | When executing query: """ FETCH PROP ON friend "100"->"1","100"->"2" YIELD friend.id; """ Then the result should be, in any order: - | friend._src | friend._dst | friend._rank | friend.id | - | "100" | "1" | 0 | 100 | - | "100" | "2" | 0 | 200 | + | friend.id | + | 100 | + | 200 | When executing query: """ FETCH PROP ON friend "100"->"1","100"->"2" YIELD friend.id AS id; """ Then the result should be, in any order: - | friend._src | friend._dst | friend._rank | id | - | "100" | "1" | 0 | 100 | - | "100" | "2" | 0 | 200 | + | id | + | 100 | + | 200 | When executing query: """ FETCH PROP ON like "100"->"1","100"->"2" YIELD like.id; """ Then the result should be, in any order: - | like._src | like._dst | like._rank | like.id | + | like.id | When executing query: """ FETCH PROP ON like "100"->"1","100"->"2" YIELD like.id AS id; """ Then the result should be, in any order: - | like._src | like._dst | like._rank | id | + | id | And drop the used space Scenario: TTLTest expire time @@ -478,13 +478,13 @@ Feature: TTLTest FETCH PROP ON person "1" YIELD person.age as age; """ Then the result should be, in any order, with relax comparison: - | VertexID | age | - | "1" | 20 | + | age | + | 20 | And wait 7 seconds When executing query: """ FETCH PROP ON person "1" YIELD person.age as age; """ Then the result should be, in any order: - | VertexID | age | + | age | And drop the used space diff --git a/tests/tck/features/update/Update.IntVid.feature b/tests/tck/features/update/Update.IntVid.feature index 4b67382da3c..2eeb1520db1 100644 --- a/tests/tck/features/update/Update.IntVid.feature +++ b/tests/tck/features/update/Update.IntVid.feature @@ -108,8 +108,8 @@ Feature: Update int vid of vertex and edge FETCH PROP ON select 200->101@0 YIELD select.grade, select.year """ Then the result should be, in any order: - | select._src | select._dst | select._rank | select.grade | select.year | - | 200 | 101 | 0 | 5 | 2018 | + | select.grade | select.year | + | 5 | 2018 | # update edge succeeded When executing query: """ @@ -122,8 +122,8 @@ Feature: Update int vid of vertex and edge FETCH PROP ON select 200->101@0 YIELD select.grade, select.year """ Then the result should be, in any order: - | select._src | select._dst | select._rank | select.grade | select.year | - | 200 | 101 | 0 | 6 | 2000 | + | select.grade | select.year | + | 6 | 2000 | When executing query: """ GO FROM 101 OVER select REVERSELY YIELD select.grade, select.year @@ -271,8 +271,8 @@ Feature: Update int vid of vertex and edge FETCH PROP ON course 103 YIELD course.name, course.credits """ Then the result should be, in any order: - | VertexID | course.name | course.credits | - | 103 | "CS" | 5 | + | course.name | course.credits | + | "CS" | 5 | # not allow to handle multi tagid when update When executing query: """ @@ -386,8 +386,8 @@ Feature: Update int vid of vertex and edge FETCH PROP ON select 200->101@0 YIELD select.grade, select.year """ Then the result should be, in any order: - | select._src | select._dst | select._rank | select.grade | select.year | - | 200 | 101 | 0 | 9 | 2019 | + | select.grade | select.year | + | 9 | 2019 | # Insertable, upsert when edge exists, 2.0 storage not support update edge with vertex prop When executing query: """ @@ -431,8 +431,8 @@ Feature: Update int vid of vertex and edge FETCH PROP ON select 601->101@0 YIELD select.grade, select.year """ Then the result should be, in any order: - | select._src | select._dst | select._rank | select.grade | select.year | - | 601 | 101 | 0 | 3 | 2019 | + | select.grade | select.year | + | 3 | 2019 | # select_default's year with default value, timestamp not support When executing query: """ @@ -518,8 +518,8 @@ Feature: Update int vid of vertex and edge FETCH PROP on building 100 YIELD building.name """ Then the result should be, in any order: - | VertexID | building.name | - | 100 | "No1" | + | building.name | + | "No1" | # insert When executing query: """ @@ -531,8 +531,8 @@ Feature: Update int vid of vertex and edge FETCH PROP on building 100 YIELD building.name """ Then the result should be, in any order: - | VertexID | building.name | - | 100 | "No2" | + | building.name | + | "No2" | When executing query: """ UPSERT VERTEX 101 SET building.name = "No1" @@ -543,8 +543,8 @@ Feature: Update int vid of vertex and edge FETCH PROP on building 101 YIELD building.name """ Then the result should be, in any order: - | VertexID | building.name | - | 101 | "No1" | + | building.name | + | "No1" | # insert When executing query: """ @@ -556,8 +556,8 @@ Feature: Update int vid of vertex and edge FETCH PROP on building 101 YIELD building.name """ Then the result should be, in any order: - | VertexID | building.name | - | 101 | "No2" | + | building.name | + | "No2" | # upsert after alter schema When executing query: """ @@ -577,8 +577,8 @@ Feature: Update int vid of vertex and edge FETCH PROP on building 100 YIELD building.name, building.new_field """ Then the result should be, in any order: - | VertexID | building.name | building.new_field | - | 100 | "No2" | "123" | + | building.name | building.new_field | + | "No2" | "123" | # upsert after alter schema When executing query: """ @@ -590,8 +590,8 @@ Feature: Update int vid of vertex and edge FETCH PROP on building 100 YIELD building.name, building.new_field """ Then the result should be, in any order: - | VertexID | building.name | building.new_field | - | 100 | "No3" | "321" | + | building.name | building.new_field | + | "No3" | "321" | # upsert after alter schema When executing query: """ @@ -603,8 +603,8 @@ Feature: Update int vid of vertex and edge FETCH PROP on building 101 YIELD building.name, building.new_field """ Then the result should be, in any order: - | VertexID | building.name | building.new_field | - | 101 | "No1" | "No2" | + | building.name | building.new_field | + | "No1" | "No2" | # Test upsert edge after alter schema When executing query: """ @@ -623,8 +623,8 @@ Feature: Update int vid of vertex and edge FETCH PROP ON like 1->100@0 YIELD like.likeness, like.new_field """ Then the result should be, in any order: - | like._src | like._dst | like._rank | like.likeness | like.new_field | - | 1 | 100 | 0 | 2.0 | "123" | + | like.likeness | like.new_field | + | 2.0 | "123" | When executing query: """ UPSERT EDGE 1->100 OF like SET likeness = 3.0, new_field = "321" @@ -635,8 +635,8 @@ Feature: Update int vid of vertex and edge FETCH PROP ON like 1->100@0 YIELD like.likeness, like.new_field """ Then the result should be, in any order: - | like._src | like._dst | like._rank | like.likeness | like.new_field | - | 1 | 100 | 0 | 3.0 | "321" | + | like.likeness | like.new_field | + | 3.0 | "321" | When executing query: """ UPSERT EDGE 1->101 OF like SET likeness = 1.0, new_field = "111" @@ -647,6 +647,6 @@ Feature: Update int vid of vertex and edge FETCH PROP ON like 1->101@0 YIELD like.likeness, like.new_field """ Then the result should be, in any order: - | like._src | like._dst | like._rank | like.likeness | like.new_field | - | 1 | 101 | 0 | 1.0 | "111" | + | like.likeness | like.new_field | + | 1.0 | "111" | Then drop the used space diff --git a/tests/tck/features/update/Update.feature b/tests/tck/features/update/Update.feature index 0f5908d1c83..95855c5014c 100644 --- a/tests/tck/features/update/Update.feature +++ b/tests/tck/features/update/Update.feature @@ -110,8 +110,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON select "200"->"101"@0 YIELD select.grade, select.year """ Then the result should be, in any order: - | select._src | select._dst | select._rank | select.grade | select.year | - | "200" | "101" | 0 | 5 | 2018 | + | select.grade | select.year | + | 5 | 2018 | # update edge succeeded When executing query: """ @@ -124,8 +124,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON select "200"->"101"@0 YIELD select.grade, select.year """ Then the result should be, in any order: - | select._src | select._dst | select._rank | select.grade | select.year | - | "200" | "101" | 0 | 6 | 2000 | + | select.grade | select.year | + | 6 | 2000 | When executing query: """ GO FROM "101" OVER select REVERSELY YIELD select.grade, select.year @@ -319,8 +319,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON course "103" YIELD course.name, course.credits """ Then the result should be, in any order: - | VertexID | course.name | course.credits | - | "103" | "CS" | 5 | + | course.name | course.credits | + | "CS" | 5 | # not allow to handle multi tagid when update When executing query: """ @@ -434,8 +434,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON select "200"->"101"@0 YIELD select.grade, select.year """ Then the result should be, in any order: - | select._src | select._dst | select._rank | select.grade | select.year | - | "200" | "101" | 0 | 9 | 2019 | + | select.grade | select.year | + | 9 | 2019 | # Insertable, upsert when edge exists, 2.0 storage not support update edge with vertex prop When executing query: """ @@ -479,8 +479,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON select "601"->"101"@0 YIELD select.grade, select.year """ Then the result should be, in any order: - | select._src | select._dst | select._rank | select.grade | select.year | - | "601" | "101" | 0 | 3 | 2019 | + | select.grade | select.year | + | 3 | 2019 | # select_default's year with default value, timestamp not support When executing query: """ @@ -565,8 +565,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON building "100" YIELD building.name """ Then the result should be, in any order: - | VertexID | building.name | - | "100" | "No1" | + | building.name | + | "No1" | # insert When executing query: """ @@ -578,8 +578,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON building "100" YIELD building.name """ Then the result should be, in any order: - | VertexID | building.name | - | "100" | "No2" | + | building.name | + | "No2" | When executing query: """ UPSERT VERTEX "101" SET building.name = "No1" @@ -590,8 +590,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON building "101" YIELD building.name """ Then the result should be, in any order: - | VertexID | building.name | - | "101" | "No1" | + | building.name | + | "No1" | # insert When executing query: """ @@ -603,8 +603,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON building "101" YIELD building.name """ Then the result should be, in any order: - | VertexID | building.name | - | "101" | "No2" | + | building.name | + | "No2" | # upsert after alter schema When executing query: """ @@ -624,8 +624,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON building "100" YIELD building.name, building.new_field """ Then the result should be, in any order: - | VertexID | building.name | building.new_field | - | "100" | "No2" | "123" | + | building.name | building.new_field | + | "No2" | "123" | # upsert after alter schema When executing query: """ @@ -637,8 +637,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON building "100" YIELD building.name, building.new_field """ Then the result should be, in any order: - | VertexID | building.name | building.new_field | - | "100" | "No3" | "321" | + | building.name | building.new_field | + | "No3" | "321" | # upsert after alter schema When executing query: """ @@ -650,8 +650,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON building "101" YIELD building.name, building.new_field """ Then the result should be, in any order: - | VertexID | building.name | building.new_field | - | "101" | "No1" | "No2" | + | building.name | building.new_field | + | "No1" | "No2" | # Test upsert edge after alter schema When executing query: """ @@ -670,8 +670,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON like "1"->"100"@0 YIELD like.likeness, like.new_field """ Then the result should be, in any order: - | like._src | like._dst | like._rank | like.likeness | like.new_field | - | "1" | "100" | 0 | 2.0 | "123" | + | like.likeness | like.new_field | + | 2.0 | "123" | When executing query: """ UPSERT EDGE "1"->"100" OF like SET likeness = 3.0, new_field = "321" @@ -682,8 +682,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON like "1"->"100"@0 YIELD like.likeness, like.new_field """ Then the result should be, in any order: - | like._src | like._dst | like._rank | like.likeness | like.new_field | - | "1" | "100" | 0 | 3.0 | "321" | + | like.likeness | like.new_field | + | 3.0 | "321" | When executing query: """ UPSERT EDGE "1"->"101" OF like SET likeness = 1.0, new_field = "111" @@ -694,8 +694,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON like "1"->"101"@0 YIELD like.likeness, like.new_field """ Then the result should be, in any order: - | like._src | like._dst | like._rank | like.likeness | like.new_field | - | "1" | "101" | 0 | 1.0 | "111" | + | like.likeness | like.new_field | + | 1.0 | "111" | Then drop the used space Scenario: update and upsert test with 2.0 syntax @@ -753,8 +753,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON select "200"->"101"@0 YIELD select.grade, select.year """ Then the result should be, in any order: - | select._src | select._dst | select._rank | select.grade | select.year | - | "200" | "101" | 0 | 5 | 2018 | + | select.grade | select.year | + | 5 | 2018 | # update edge succeeded When executing query: """ @@ -767,8 +767,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON select "200"->"101"@0 YIELD select.grade, select.year """ Then the result should be, in any order: - | select._src | select._dst | select._rank | select.grade | select.year | - | "200" | "101" | 0 | 6 | 2000 | + | select.grade | select.year | + | 6 | 2000 | When executing query: """ GO FROM "101" OVER select REVERSELY YIELD select.grade, select.year @@ -856,8 +856,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON course "103" YIELD course.name, course.credits """ Then the result should be, in any order: - | VertexID | course.name | course.credits | - | "103" | "CS" | 5 | + | course.name | course.credits | + | "CS" | 5 | When executing query: """ UPDATE VERTEX ON course "103" @@ -954,8 +954,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON select "200"->"101"@0 YIELD select.grade, select.year """ Then the result should be, in any order: - | select._src | select._dst | select._rank | select.grade | select.year | - | "200" | "101" | 0 | 9 | 2019 | + | select.grade | select.year | + | 9 | 2019 | When executing query: """ UPSERT EDGE ON select "201" -> "101"@0 @@ -990,8 +990,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON select "601"->"101"@0 YIELD select.grade, select.year """ Then the result should be, in any order: - | select._src | select._dst | select._rank | select.grade | select.year | - | "601" | "101" | 0 | 3 | 2019 | + | select.grade | select.year | + | 3 | 2019 | # select_default's year with default value, timestamp not support When executing query: """ @@ -1067,8 +1067,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON building "100" YIELD building.name """ Then the result should be, in any order: - | VertexID | building.name | - | "100" | "No1" | + | building.name | + | "No1" | # insert When executing query: """ @@ -1080,8 +1080,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON building "100" YIELD building.name """ Then the result should be, in any order: - | VertexID | building.name | - | "100" | "No2" | + | building.name | + | "No2" | When executing query: """ UPSERT VERTEX ON building "101" SET name = "No1" @@ -1092,8 +1092,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON building "101" YIELD building.name """ Then the result should be, in any order: - | VertexID | building.name | - | "101" | "No1" | + | building.name | + | "No1" | # insert When executing query: """ @@ -1105,8 +1105,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON building "101" YIELD building.name """ Then the result should be, in any order: - | VertexID | building.name | - | "101" | "No2" | + | building.name | + | "No2" | # upsert after alter schema When executing query: """ @@ -1126,8 +1126,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON building "100" YIELD building.name, building.new_field """ Then the result should be, in any order: - | VertexID | building.name | building.new_field | - | "100" | "No2" | "123" | + | building.name | building.new_field | + | "No2" | "123" | # upsert after alter schema When executing query: """ @@ -1139,8 +1139,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON building "100" YIELD building.name, building.new_field """ Then the result should be, in any order: - | VertexID | building.name | building.new_field | - | "100" | "No3" | "321" | + | building.name | building.new_field | + | "No3" | "321" | # upsert after alter schema When executing query: """ @@ -1152,8 +1152,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON building "101" YIELD building.name, building.new_field """ Then the result should be, in any order: - | VertexID | building.name | building.new_field | - | "101" | "No1" | "No2" | + | building.name | building.new_field | + | "No1" | "No2" | # Test upsert edge after alter schema When executing query: """ @@ -1172,8 +1172,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON like "1"->"100"@0 YIELD like.likeness, like.new_field """ Then the result should be, in any order: - | like._src | like._dst | like._rank | like.likeness | like.new_field | - | "1" | "100" | 0 | 2.0 | "123" | + | like.likeness | like.new_field | + | 2.0 | "123" | When executing query: """ UPSERT EDGE ON like "1"->"100" SET likeness = 3.0, new_field = "321" @@ -1184,8 +1184,8 @@ Feature: Update string vid of vertex and edge FETCH PROP ON like "1"->"100"@0 YIELD like.likeness, like.new_field """ Then the result should be, in any order: - | like._src | like._dst | like._rank | like.likeness | like.new_field | - | "1" | "100" | 0 | 3.0 | "321" | + | like.likeness | like.new_field | + | 3.0 | "321" | When executing query: """ UPSERT EDGE ON like "1"->"101" SET likeness = 1.0, new_field = "111" @@ -1196,6 +1196,6 @@ Feature: Update string vid of vertex and edge FETCH PROP ON like "1"->"101"@0 YIELD like.likeness, like.new_field """ Then the result should be, in any order: - | like._src | like._dst | like._rank | like.likeness | like.new_field | - | "1" | "101" | 0 | 1.0 | "111" | + | like.likeness | like.new_field | + | 1.0 | "111" | Then drop the used space diff --git a/tests/tck/features/yield/yield.IntVid.feature b/tests/tck/features/yield/yield.IntVid.feature index 7efa4afc5c4..e00a0c10284 100644 --- a/tests/tck/features/yield/yield.IntVid.feature +++ b/tests/tck/features/yield/yield.IntVid.feature @@ -410,14 +410,14 @@ Feature: Yield Sentence | 34.666666666666664 | 270 | 3 | 2 | When executing query: """ - GO FROM hash("Carmelo Anthony") OVER like | YIELD COUNT(*) + GO FROM hash("Carmelo Anthony") OVER like YIELD like._dst| YIELD COUNT(*) """ Then the result should be, in any order: | COUNT(*) | | 3 | When executing query: """ - GO FROM hash("Carmelo Anthony") OVER like | YIELD 1 + GO FROM hash("Carmelo Anthony") OVER like YIELD edge as e| YIELD 1 """ Then the result should be, in any order: | 1 | @@ -426,7 +426,7 @@ Feature: Yield Sentence | 1 | When executing query: """ - GO FROM hash("Nobody") OVER like | YIELD 1 + GO FROM hash("Nobody") OVER like YIELD like._dst | YIELD 1 """ Then the result should be, in any order: | 1 | diff --git a/tests/tck/features/yield/yield.feature b/tests/tck/features/yield/yield.feature index 89a6e2a5d21..01ca33e0b6a 100644 --- a/tests/tck/features/yield/yield.feature +++ b/tests/tck/features/yield/yield.feature @@ -420,14 +420,14 @@ Feature: Yield Sentence | 34.666666666666664 | 270 | 3 | 2 | When executing query: """ - GO FROM "Carmelo Anthony" OVER like | YIELD COUNT(*) + GO FROM "Carmelo Anthony" OVER like YIELD like._dst| YIELD COUNT(*) """ Then the result should be, in any order, with relax comparison: | COUNT(*) | | 3 | When executing query: """ - GO FROM "Carmelo Anthony" OVER like | YIELD 1 + GO FROM "Carmelo Anthony" OVER like YIELD edge as e| YIELD 1 """ Then the result should be, in any order, with relax comparison: | 1 | @@ -436,7 +436,7 @@ Feature: Yield Sentence | 1 | When executing query: """ - GO FROM "Nobody" OVER like | YIELD 1 + GO FROM "Nobody" OVER like YIELD like._dst| YIELD 1 """ Then the result should be, in any order, with relax comparison: | 1 | diff --git a/tests/tck/slowquery/KillSlowQueryViaDiffrentService.feature b/tests/tck/slowquery/KillSlowQueryViaDiffrentService.feature index 9464dc08111..f277c9c2672 100644 --- a/tests/tck/slowquery/KillSlowQueryViaDiffrentService.feature +++ b/tests/tck/slowquery/KillSlowQueryViaDiffrentService.feature @@ -10,7 +10,7 @@ Feature: Slow Query Test Given a graph with space named "nba" When executing query via graph 0: """ - GO 100000 STEPS FROM "Tim Duncan" OVER like + GO 100000 STEPS FROM "Tim Duncan" OVER like YIELD like._dst """ Then an ExecutionError should be raised at runtime: Execution had been killed @@ -32,8 +32,8 @@ Feature: Slow Query Test SHOW ALL QUERIES """ Then the result should be, in order: - | SessionID | ExecutionPlanID | User | Host | StartTime | DurationInUSec | Status | Query | - | /\d+/ | /\d+/ | "root" | /.*/ | /.*/ | /\d+/ | "RUNNING" | "GO 100000 STEPS FROM \"Tim Duncan\" OVER like" | + | SessionID | ExecutionPlanID | User | Host | StartTime | DurationInUSec | Status | Query | + | /\d+/ | /\d+/ | "root" | /.*/ | /.*/ | /\d+/ | "RUNNING" | "GO 100000 STEPS FROM \"Tim Duncan\" OVER like YIELD like._dst" | When executing query via graph 1: """ SHOW ALL QUERIES diff --git a/tests/tck/slowquery/KillSlowQueryViaSameService.feature b/tests/tck/slowquery/KillSlowQueryViaSameService.feature index e0ec3a06b54..21bacbb53d1 100644 --- a/tests/tck/slowquery/KillSlowQueryViaSameService.feature +++ b/tests/tck/slowquery/KillSlowQueryViaSameService.feature @@ -10,7 +10,7 @@ Feature: Slow Query Test Given a graph with space named "nba" When executing query: """ - GO 100000 STEPS FROM "Tim Duncan" OVER like + GO 100000 STEPS FROM "Tim Duncan" OVER like YIELD like._dst """ Then an ExecutionError should be raised at runtime: Execution had been killed @@ -32,8 +32,8 @@ Feature: Slow Query Test SHOW ALL QUERIES """ Then the result should be, in order: - | SessionID | ExecutionPlanID | User | Host | StartTime | DurationInUSec | Status | Query | - | /\d+/ | /\d+/ | "root" | /.*/ | /.*/ | /\d+/ | "RUNNING" | "GO 100000 STEPS FROM \"Tim Duncan\" OVER like" | + | SessionID | ExecutionPlanID | User | Host | StartTime | DurationInUSec | Status | Query | + | /\d+/ | /\d+/ | "root" | /.*/ | /.*/ | /\d+/ | "RUNNING" | "GO 100000 STEPS FROM \"Tim Duncan\" OVER like YIELD like._dst" | When executing query: """ SHOW ALL QUERIES