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

piped fetch prop not working as expected for multiple edge pattern #4222

Open
wey-gu opened this issue May 4, 2022 · 2 comments
Open

piped fetch prop not working as expected for multiple edge pattern #4222

wey-gu opened this issue May 4, 2022 · 2 comments
Labels
type/enhancement Type: make the code neat or more efficient

Comments

@wey-gu
Copy link
Contributor

wey-gu commented May 4, 2022

Please check the FAQ documentation before raising an issue

The multiple edge pattern like the following:

(root@nebula) [basketballplayer]> FETCH PROP ON serve "player100" -> "team204", "player133" -> "team202" YIELD edge AS e;
+-----------------------------------------------------------------------+
| e                                                                     |
+-----------------------------------------------------------------------+
| [:serve "player100"->"team204" @0 {end_year: 2016, start_year: 1997}] |
| [:serve "player133"->"team202" @0 {end_year: 2011, start_year: 2002}] |
+-----------------------------------------------------------------------+
Got 2 rows (time spent 3285/9989 us)

doesn't work in this case:

(root@nebula) [basketballplayer]> go from "player100" over follow yield id($$) as alliasId, "player102" as v3 | FETCH PROP ON follow $-.alliasId -> $-.v3@0 YIELD properties(edge);
+------------------+
| properties(EDGE) |
+------------------+
| {degree: 90}     |
+------------------+
Got 1 rows (time spent 9009/23040 us)

(root@nebula) [basketballplayer]> go from "player100" over follow yield id($$) as alliasId, "player102" as v3 | FETCH PROP ON follow $-.alliasId -> $-.v3, $-.alliasId -> $-.v3@1 YIELD properties(edge);
[ERROR (-1004)]: SyntaxError: syntax error near `, $-.all'

Describe the bug (required)

As above, only edge_key_ref in singular case was implemented for now.

edge_key_ref
    : input_prop_expression R_ARROW input_prop_expression AT input_prop_expression {
        $$ = new EdgeKeyRef($1, $3, $5);
    }
    | input_prop_expression R_ARROW input_prop_expression AT constant_expression {
        $$ = new EdgeKeyRef($1, $3, $5);
    }
    | var_prop_expression R_ARROW var_prop_expression AT var_prop_expression {
        $$ = new EdgeKeyRef($1, $3, $5, false);
    }
    | var_prop_expression R_ARROW var_prop_expression AT constant_expression {
        $$ = new EdgeKeyRef($1, $3, $5, false);
    }
    | input_prop_expression R_ARROW input_prop_expression {
        $$ = new EdgeKeyRef($1, $3, ConstantExpression::make(qctx->objPool(), 0));
    }
    | var_prop_expression R_ARROW var_prop_expression {
        $$ = new EdgeKeyRef($1, $3, ConstantExpression::make(qctx->objPool(), 0), false);
    }
    ;

fetch_edges_sentence
    : KW_FETCH KW_PROP KW_ON name_label_list edge_keys yield_clause {
        auto fetch = new FetchEdgesSentence($4, $5, $6);
        $$ = fetch;
    }
    | KW_FETCH KW_PROP KW_ON name_label_list edge_key_ref yield_clause {
        auto fetch = new FetchEdgesSentence($4, $5, $6);
        $$ = fetch;
    }
    ;

Your Environments (required)

  • OS: uname -a
  • Compiler: g++ --version or clang++ --version
  • CPU: lscpu
  • Commit id 3.0

How To Reproduce(required)

as above

Expected behavior

Additional context

#4188

@wey-gu wey-gu added the type/bug Type: something is unexpected label May 4, 2022
@wey-gu
Copy link
Contributor Author

wey-gu commented May 4, 2022

Another thing is that we only support either both or non peer of the fetch prop edge pattern to be variable, that is.
we only support:

  • fetch on serve "player133" -> "team202"
  • yield "foo" as a, "bar" as bar | fetch on serve $-.a -> $-.b

while not support :

  • yield "foo" as a, "bar" as bar | fetch on serve $-.a -> "bar"

reported in #4191

@wey-gu wey-gu added type/enhancement Type: make the code neat or more efficient and removed type/bug Type: something is unexpected labels May 4, 2022
@wey-gu
Copy link
Contributor Author

wey-gu commented May 4, 2022

Mitigation for now was to use union

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Type: make the code neat or more efficient
Projects
None yet
Development

No branches or pull requests

1 participant