Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry pick from master to v2.6.1 #3250

Merged
merged 2 commits into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,20 @@ jobs:
- tools
steps:
- uses: actions/checkout@v2
- name: Build and push Docker images
uses: docker/build-push-action@v1
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: vesoft/nebula-${{ matrix.service }}
path: .
dockerfile: docker/Dockerfile.${{ matrix.service }}
tags: nightly,v2-nightly
cache_froms: vesoft/nebula-dev:centos7
add_git_labels: true
- uses: docker/build-push-action@v2
with:
context: .
file: ./docker/Dockerfile.${{ matrix.service }}
platforms: linux/amd64,linux/arm64
tags: |
vesoft/nebula-${{ matrix.service }}:nightly
push: true

coverage:
name: coverage
Expand All @@ -84,7 +87,6 @@ jobs:
- ubuntu2004
compiler:
- gcc-9.2

container:
image: vesoft/nebula-dev:${{ matrix.os }}
env:
Expand Down Expand Up @@ -113,11 +115,12 @@ jobs:
-DENABLE_TESTING=on \
-DENABLE_COVERAGE=on \
-B build
echo "::set-output name=j::10"
echo "::set-output name=t::10"
echo "::set-output name=j::8"
echo "::set-output name=t::6"
- name: Make
run: |
ccache -z
cmake --build build/ -j ${{ steps.cmake.outputs.j }} --target nebula-metad nebula-storaged nebula-graphd
cmake --build build/ -j ${{ steps.cmake.outputs.t }}
ccache -s
- name: CTest
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
tag="vesoft/nebula-${{ matrix.service }}:latest"
fi
echo "::set-output name=tag::$tag"
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
Expand All @@ -87,6 +88,7 @@ jobs:
with:
context: .
file: ./docker/Dockerfile.${{ matrix.service }}
platforms: linux/amd64,linux/arm64
tags: |
vesoft/nebula-${{ matrix.service }}:${{ steps.tagname.outputs.tag }}
vesoft/nebula-${{ matrix.service }}:${{ steps.tagname.outputs.majorver }}
Expand Down
4 changes: 2 additions & 2 deletions src/graph/validator/LookupValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Status LookupValidator::validateYieldEdge() {
auto yieldExpr = lookupCtx_->yieldExpr;
for (auto col : yield->columns()) {
if (ExpressionUtils::hasAny(col->expr(),
{Expression::Kind::kPathBuild, Expression::Kind::kVertex})) {
{Expression::Kind::kAggregate, Expression::Kind::kVertex})) {
return Status::SemanticError("illegal yield clauses `%s'", col->toString().c_str());
}
if (ExpressionUtils::hasAny(col->expr(), {Expression::Kind::kEdge})) {
Expand Down Expand Up @@ -136,7 +136,7 @@ Status LookupValidator::validateYieldTag() {
auto yieldExpr = lookupCtx_->yieldExpr;
for (auto col : yield->columns()) {
if (ExpressionUtils::hasAny(col->expr(),
{Expression::Kind::kPathBuild, Expression::Kind::kEdge})) {
{Expression::Kind::kAggregate, Expression::Kind::kEdge})) {
return Status::SemanticError("illegal yield clauses `%s'", col->toString().c_str());
}
if (ExpressionUtils::hasAny(col->expr(), {Expression::Kind::kVertex})) {
Expand Down
5 changes: 5 additions & 0 deletions src/graph/validator/test/LookupValidatorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ TEST_F(LookupValidatorTest, wrongYield) {
EXPECT_EQ(std::string(result.message()),
"SyntaxError: please add alias when using `vertex'. near `vertex'");
}
{
std::string query = "LOOKUP ON person YIELD count(*)";
auto result = checkResult(query);
EXPECT_EQ(std::string(result.message()), "SemanticError: illegal yield clauses `count(*)'");
}
{
std::string query = "LOOKUP ON person YIELD vertex as node, edge";
auto result = checkResult(query);
Expand Down
7 changes: 7 additions & 0 deletions tests/tck/features/lookup/WithYield.feature
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,10 @@ Feature: Lookup with yield
| "Marco Belinelli" | "Tony Parker" | 0 | 50 | [:like "Marco Belinelli"->"Tony Parker" @0 {likeness: 50}] |
| "Rajon Rondo" | "Ray Allen" | 0 | -1 | [:like "Rajon Rondo"->"Ray Allen" @0 {likeness: -1}] |
| "Ray Allen" | "Rajon Rondo" | 0 | 9 | [:like "Ray Allen"->"Rajon Rondo" @0 {likeness: 9}] |
When executing query:
"""
LOOKUP ON like WHERE like.likeness < 50 + 1 YIELD like.likeness, edge as relationship | YIELD count(*) as nums
"""
Then the result should be, in any order:
| nums |
| 6 |
8 changes: 8 additions & 0 deletions tests/tck/features/lookup/WithYield.intVid.feature
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,11 @@ Feature: Lookup with yield in integer vid
| "Marco Belinelli" | "Tony Parker" | 0 | 50 | [:like "Marco Belinelli"->"Tony Parker" @0 {likeness: 50}] |
| "Rajon Rondo" | "Ray Allen" | 0 | -1 | [:like "Rajon Rondo"->"Ray Allen" @0 {likeness: -1}] |
| "Ray Allen" | "Rajon Rondo" | 0 | 9 | [:like "Ray Allen"->"Rajon Rondo" @0 {likeness: 9}] |
When executing query:
"""
LOOKUP ON serve WHERE serve.start_year == 2008 and serve.end_year == 2019
YIELD serve.start_year AS startYear | YIELD count(*) as nums
"""
Then the result should be, in any order:
| nums |
| 2 |
2 changes: 1 addition & 1 deletion third-party/install-cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Always use bash
shell=$(basename $(readlink /proc/$$/exe))
if [ ! x$shell = x"bash" ]
if [ ! x$shell = x"bash" ] && [[ x$shell != x"qemu-aarch64"* ]]
then
bash $0 $@
exit $?
Expand Down
2 changes: 1 addition & 1 deletion third-party/install-gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Always use bash
shell=$(basename $(readlink /proc/$$/exe))
if [ ! x$shell = x"bash" ]
if [ ! x$shell = x"bash" ] && [[ x$shell != x"qemu-aarch64"* ]]
then
bash $0 $@
exit $?
Expand Down
2 changes: 1 addition & 1 deletion third-party/install-third-party.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Always use bash
shell=$(basename $(readlink /proc/$$/exe))
if [ ! x$shell = x"bash" ]
if [ ! x$shell = x"bash" ] && [[ x$shell != x"qemu-aarch64"* ]]
then
bash $0 $@
exit $?
Expand Down