Repository navigation
Local callables status codes #539
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
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| = 42NAF | ||
|
|
||
| == Status description | ||
| error: syntax error or access rule violation - not supported local procedure definition. USE clause is not supported in local procedure definitions. | ||
|
|
||
| == Explanation | ||
|
|
||
| The `USE` clause is not supported in local procedure definitions, i.e., it cannot be used in the body of a local procedure definition. | ||
|
|
||
| == Example scenarios | ||
|
|
||
| Let's take the following example scenarios: | ||
|
|
||
| === `USE` in a local procedure definition | ||
|
|
||
| Try querying a specific graph in a local procedure body: | ||
|
|
||
| [source,cypher] | ||
| ---- | ||
| DEFINE PROCEDURE foo.baz() { | ||
| USE graph | ||
| FINISH | ||
| } | ||
|
|
||
| CALL foo.baz() | ||
| FINISH; | ||
| ---- | ||
|
|
||
| The query returns a chain of errors where GQLSTATUS 42NAF is the cause of GQLSTATUS xref:errors/gql-errors/42001.adoc[42001]: | ||
|
|
||
| .GQLSTATUS error chain | ||
| [source, error] | ||
| ---- | ||
| 42NAF: syntax error or access rule violation - not supported local procedure definition. USE clause is not supported in local procedure definitions. | ||
| 42001: syntax error or access rule violation - invalid syntax | ||
| ---- | ||
|
|
||
| In this case, remove the `USE` from the procedure body. | ||
|
|
||
| === `USE` with UNION in a local procedure definition | ||
|
|
||
| Try querying fabric graph constituents in a local procedure body: | ||
|
|
||
| [source,cypher] | ||
| ---- | ||
| DEFINE PROCEDURE foo.baz() { | ||
| USE constituent1 | ||
| MATCH (n) RETURN n | ||
| UNION | ||
| USE constituent2 | ||
| MATCH (n) RETURN n | ||
| } | ||
|
|
||
| CALL foo.baz() YIELD n | ||
| RETURN n; | ||
| ---- | ||
|
|
||
| The query returns a chain of errors where GQLSTATUS 42NAF is the cause of GQLSTATUS xref:errors/gql-errors/42001.adoc[42001]: | ||
|
|
||
| .GQLSTATUS error chain | ||
| [source, error] | ||
| ---- | ||
| 42NAF: syntax error or access rule violation - not supported local procedure definition. USE clause is not supported in local procedure definitions. | ||
| 42001: syntax error or access rule violation - invalid syntax | ||
| ---- | ||
|
|
||
| In this case, remove the `USE` from the procedure body. | ||
|
|
||
| ifndef::backend-pdf[] | ||
| [discrete.glossary] | ||
| == Glossary | ||
|
|
||
| include::partial$glossary.adoc[] | ||
| endif::[] | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,70 @@ | ||||||
| = 42NAG | ||||||
|
|
||||||
| == Status description | ||||||
| error: syntax error or access rule violation - not supported local function definition. USE clause is not supported in local function definitions. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| == Explanation | ||||||
|
|
||||||
| The `USE` clause is not supported in local function definitions, i.e., it cannot be used in the body of a local function definition. | ||||||
|
|
||||||
| == Example scenarios | ||||||
|
|
||||||
| Let's take the following example scenarios: | ||||||
|
|
||||||
| === `USE` in a local function definition | ||||||
|
|
||||||
| Try querying a specific graph in a local function body: | ||||||
|
|
||||||
| [source,cypher] | ||||||
| ---- | ||||||
| DEFINE FUNCTION numberOfNodes() { | ||||||
| USE graph | ||||||
| MATCH (n) | ||||||
| RETURN COUNT(n) | ||||||
| } | ||||||
|
|
||||||
| RETURN numberOfNodes(); | ||||||
| ---- | ||||||
|
|
||||||
| The query returns a chain of errors where GQLSTATUS 42NAG is the cause of GQLSTATUS xref:errors/gql-errors/42001.adoc[42001]: | ||||||
|
|
||||||
| .GQLSTATUS error chain | ||||||
| [source, error] | ||||||
| ---- | ||||||
| 42NAG: syntax error or access rule violation - not supported local function definition. USE clause is not supported in local function definitions. | ||||||
| 42001: syntax error or access rule violation - invalid syntax | ||||||
| ---- | ||||||
|
|
||||||
| In this case, remove the `USE` from the function body. | ||||||
|
|
||||||
| === `USE` in a local function definition with expression body | ||||||
| Try querying a specific graph in a local function expression body: | ||||||
|
|
||||||
| [source,cypher] | ||||||
| ---- | ||||||
| DEFINE FUNCTION foo.baz() = head(COLLECT { | ||||||
| USE graph | ||||||
| MATCH (n) | ||||||
| RETURN COUNT(n) | ||||||
| }) | ||||||
|
|
||||||
| RETURN numberOfNodes(); | ||||||
| ---- | ||||||
|
|
||||||
| The query returns a chain of errors where GQLSTATUS 42NAG is the cause of GQLSTATUS xref:errors/gql-errors/42001.adoc[42001]: | ||||||
|
|
||||||
| .GQLSTATUS error chain | ||||||
| [source, error] | ||||||
| ---- | ||||||
| 42NAG: syntax error or access rule violation - not supported local function definition. USE clause is not supported in local function definitions. | ||||||
| 42001: syntax error or access rule violation - invalid syntax | ||||||
| ---- | ||||||
|
|
||||||
| In this case, remove the `USE` from the function body. | ||||||
|
|
||||||
| ifndef::backend-pdf[] | ||||||
| [discrete.glossary] | ||||||
| == Glossary | ||||||
|
|
||||||
| include::partial$glossary.adoc[] | ||||||
| endif::[] | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,69 @@ | ||||||
| = 42NAH | ||||||
|
|
||||||
| == Status description | ||||||
| error: syntax error or access rule violation - return column error. Return column `{ <<variable>> }` does not match output signature of local procedure `{ <<proc>> }`. | ||||||
|
hvub marked this conversation as resolved.
JoelBergstrand marked this conversation as resolved.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| == Explanation | ||||||
|
|
||||||
| The result columns of a local procedure body do not match the output signature of the local procedure. | ||||||
|
|
||||||
| == Example scenarios | ||||||
|
|
||||||
| Let's take the following example scenarios: | ||||||
|
|
||||||
| === `RETURN` a column in the body of a local void procedure | ||||||
|
|
||||||
| Try returning a column in the body of a local procedure with an empty output signature (`+::+ ()`): | ||||||
|
|
||||||
| [source,cypher] | ||||||
| ---- | ||||||
| DEFINE PROCEDURE one() :: () { | ||||||
| RETURN 1 AS a | ||||||
| } | ||||||
|
|
||||||
| CALL one() YIELD a | ||||||
| RETURN a; | ||||||
| ---- | ||||||
|
|
||||||
| The query returns a chain of errors where GQLSTATUS 42NAH is the cause of GQLSTATUS xref:errors/gql-errors/42001.adoc[42001]: | ||||||
|
|
||||||
| .GQLSTATUS error chain | ||||||
| [source, error] | ||||||
| ---- | ||||||
| 42NAH: syntax error or access rule violation - return column error. Return column `a` does not match output signature of local procedure `one`. | ||||||
| 42001: syntax error or access rule violation - invalid syntax | ||||||
| ---- | ||||||
|
|
||||||
| In this case, use `FINISH` instead of `RETURN`. | ||||||
|
|
||||||
| === `RETURN` an additional column in the body of a local procedure | ||||||
|
|
||||||
| Try returning a column in the body of a local procedure that does not appear in the output signature of the local procedure: | ||||||
|
|
||||||
| [source,cypher] | ||||||
| ---- | ||||||
| DEFINE PROCEDURE one() :: (a :: INT) { | ||||||
| RETURN 1 AS a, 2 AS b | ||||||
| } | ||||||
|
|
||||||
| CALL one() YIELD a AS x | ||||||
| RETURN x; | ||||||
| ---- | ||||||
|
|
||||||
| The query returns a chain of errors where GQLSTATUS 42NAH is the cause of GQLSTATUS xref:errors/gql-errors/42001.adoc[42001]: | ||||||
|
|
||||||
| .GQLSTATUS error chain | ||||||
| [source, error] | ||||||
| ---- | ||||||
| 42NAH: syntax error or access rule violation - return column error. Return column `b` does not match output signature of local procedure `one`. | ||||||
| 42001: syntax error or access rule violation - invalid syntax | ||||||
| ---- | ||||||
|
|
||||||
| In this case, remove the non-matching return column from the `RETURN` of the procedure body. | ||||||
|
|
||||||
| ifndef::backend-pdf[] | ||||||
| [discrete.glossary] | ||||||
| == Glossary | ||||||
|
|
||||||
| include::partial$glossary.adoc[] | ||||||
| endif::[] | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,95 @@ | ||||||
| = 42NAI | ||||||
|
|
||||||
| == Status description | ||||||
| error: syntax error or access rule violation - missing return column. Return column `{ <<variable>> }` is missing to match output signature of local procedure `{ <<proc>> }`. | ||||||
|
JoelBergstrand marked this conversation as resolved.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about something like:
Suggested change
|
||||||
|
|
||||||
| == Explanation | ||||||
|
|
||||||
| The body of a local procedure has too few result columns to match the output signature of the local procedure. | ||||||
| The error points to one specific column that is missing. | ||||||
|
|
||||||
| == Example scenarios | ||||||
|
|
||||||
| Let's take the following example scenarios: | ||||||
|
|
||||||
| === `FINISH` at the end of a local non-void procedure's body | ||||||
|
|
||||||
| Try ending a procedure body of a local non-void procedure with `FINISH`: | ||||||
|
|
||||||
| [source,cypher] | ||||||
| ---- | ||||||
| DEFINE PROCEDURE one() :: (a :: INT) { | ||||||
| FINISH | ||||||
| } | ||||||
|
|
||||||
| CALL foo.a() | ||||||
| RETURN a; | ||||||
| ---- | ||||||
|
|
||||||
| The query returns a chain of errors where GQLSTATUS 42NAI is the cause of GQLSTATUS xref:errors/gql-errors/42001.adoc[42001]: | ||||||
|
|
||||||
| .GQLSTATUS error chain | ||||||
| [source, error] | ||||||
| ---- | ||||||
| 42NAI: syntax error or access rule violation - missing return column. Return column `a` is missing to match output signature of local procedure `one`. | ||||||
| 42001: syntax error or access rule violation - invalid syntax | ||||||
| ---- | ||||||
|
|
||||||
| In this case, replace `FINISH` with `RETURN ... AS <missing column>` instead. | ||||||
|
|
||||||
| === `UPDATE` clause at the end of a local non-void procedure's body | ||||||
|
|
||||||
| Try ending a procedure body of a local non-void procedure with an update clause (`CREATE`, `INSERT`, `MERGE`, `SET`, `REMOVE`, or `DELETE`): | ||||||
|
|
||||||
| [source,cypher] | ||||||
| ---- | ||||||
| DEFINE PROCEDURE createNode() :: (n :: NODE) { | ||||||
| CREATE (n:A) | ||||||
| } | ||||||
|
|
||||||
| CALL createNode() YIELD n | ||||||
| RETURN n; | ||||||
| ---- | ||||||
|
|
||||||
| The query returns a chain of errors where GQLSTATUS 42NAI is the cause of GQLSTATUS xref:errors/gql-errors/42001.adoc[42001]: | ||||||
|
|
||||||
| .GQLSTATUS error chain | ||||||
| [source, error] | ||||||
| ---- | ||||||
| 42NAI: syntax error or access rule violation - missing return column. Return column `n` is missing to match output signature of local procedure `createNode`. | ||||||
| 42001: syntax error or access rule violation - invalid syntax | ||||||
| ---- | ||||||
|
|
||||||
| In this case, add `RETURN ... AS <missing column>` at the end of the local procedure's body. | ||||||
|
|
||||||
| === RETURN too few columns in the body of a local procedure | ||||||
|
|
||||||
| Try returning fewer columns in the body of a local procedure than the number listed in its output signature: | ||||||
|
|
||||||
| [source,cypher] | ||||||
| ---- | ||||||
| DEFINE PROCEDURE two() :: (a :: INT, b :: INT) { | ||||||
| RETURN 1 AS a | ||||||
| } | ||||||
|
|
||||||
| CALL two() YIELD a AS x, b AS y | ||||||
| RETURN x, y; | ||||||
| ---- | ||||||
|
|
||||||
| The query returns a chain of errors where GQLSTATUS 42NAI is the cause of GQLSTATUS xref:errors/gql-errors/42001.adoc[42001]: | ||||||
|
|
||||||
| .GQLSTATUS error chain | ||||||
| [source, error] | ||||||
| ---- | ||||||
| 42NAI: syntax error or access rule violation - missing return column. Return column `b` is missing to match output signature of local procedure `two`. | ||||||
| 42001: syntax error or access rule violation - invalid syntax | ||||||
| ---- | ||||||
|
|
||||||
| In this case, add a return item `... AS <missing column>` to `RETURN` at the end of the local procedure's body. | ||||||
|
|
||||||
| ifndef::backend-pdf[] | ||||||
| [discrete.glossary] | ||||||
| == Glossary | ||||||
|
|
||||||
| include::partial$glossary.adoc[] | ||||||
| endif::[] | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,70 @@ | ||||||
| = 42NAJ | ||||||
|
|
||||||
| == Status description | ||||||
| error: syntax error or access rule violation - not supported local procedure output type. `{ <<valueType>> }` is not supported as local procedure output type. Adjust the type of output field `{ <<variable>> }` of local procedure `{ <<proc>> }`. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| == Explanation | ||||||
|
|
||||||
| A return column in the output signature of a local procedure has a Cypher type that is not supported as a return column type. | ||||||
| The error points to one specific column and procedure. | ||||||
|
|
||||||
| == Example scenarios | ||||||
|
|
||||||
| Let's take the following example scenarios: | ||||||
|
|
||||||
| === `NOT NULL` type in the output signature | ||||||
|
|
||||||
| Try declaring a return column of a local procedure as `NOT NULL`: | ||||||
|
|
||||||
| [source,cypher] | ||||||
| ---- | ||||||
| DEFINE PROCEDURE proc() :: (a :: INT, b :: INT NOT NULL) { | ||||||
| RETURN null AS a, 2 AS b | ||||||
| } | ||||||
|
|
||||||
| CALL proc() YIELD a AS x, b AS y | ||||||
| RETURN x, y; | ||||||
| ---- | ||||||
|
|
||||||
| The query returns a chain of errors where GQLSTATUS 42NAJ is the cause of GQLSTATUS xref:errors/gql-errors/42001.adoc[42001]: | ||||||
|
|
||||||
| .GQLSTATUS error chain | ||||||
| [source, error] | ||||||
| ---- | ||||||
| 42NAJ: syntax error or access rule violation - not supported local procedure output type. `INTEGER NOT NULL` is not supported as local procedure output type. Adjust the type of output field `b` of local procedure `proc`. | ||||||
| 42001: syntax error or access rule violation - invalid syntax | ||||||
| ---- | ||||||
|
|
||||||
| In this case, remove `NOT NULL` in the output signature. | ||||||
|
|
||||||
| === `LIST<... NOT NULL>` type in the output signature | ||||||
|
|
||||||
| Try declaring a return column as a list type with an `NOT NULL`-element type in the output signature of a local procedure: | ||||||
|
|
||||||
| [source,cypher] | ||||||
| ---- | ||||||
| DEFINE PROCEDURE list() :: (a :: LIST<INT NOT NULL>) { | ||||||
| RETURN [1] AS a | ||||||
| } | ||||||
|
|
||||||
| CALL list() YIELD n | ||||||
| RETURN n; | ||||||
| ---- | ||||||
|
|
||||||
| The query returns a chain of errors where GQLSTATUS 42NAJ is the cause of GQLSTATUS xref:errors/gql-errors/42001.adoc[42001]: | ||||||
|
|
||||||
| .GQLSTATUS error chain | ||||||
| [source, error] | ||||||
| ---- | ||||||
| 42NAJ: syntax error or access rule violation - not supported local procedure output type. `LIST<INTEGER NOT NULL>` is not supported as local procedure output type. Adjust the type of output field `a` of local procedure `list`. | ||||||
| 42001: syntax error or access rule violation - invalid syntax | ||||||
| ---- | ||||||
|
|
||||||
| In this case, remove `NOT NULL` in the output signature. | ||||||
|
|
||||||
| ifndef::backend-pdf[] | ||||||
| [discrete.glossary] | ||||||
| == Glossary | ||||||
|
|
||||||
| include::partial$glossary.adoc[] | ||||||
| endif::[] | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.