Skip to content
Open
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
9 changes: 9 additions & 0 deletions modules/ROOT/content-nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,16 @@
**** xref:errors/gql-errors/42NAC.adoc[]
**** xref:errors/gql-errors/42NAD.adoc[]
**** xref:errors/gql-errors/42NAE.adoc[]
**** xref:errors/gql-errors/42NAF.adoc[]
**** xref:errors/gql-errors/42NAG.adoc[]
**** xref:errors/gql-errors/42NAH.adoc[]
**** xref:errors/gql-errors/42NAI.adoc[]
**** xref:errors/gql-errors/42NAJ.adoc[]
**** xref:errors/gql-errors/42NAK.adoc[]
**** xref:errors/gql-errors/42NAL.adoc[]
**** xref:errors/gql-errors/42NAM.adoc[]
**** xref:errors/gql-errors/42NAN.adoc[]
**** xref:errors/gql-errors/42NAO.adoc[]
**** xref:errors/gql-errors/42NAP.adoc[]
**** xref:errors/gql-errors/42NFC.adoc[]
**** xref:errors/gql-errors/42NFD.adoc[]
Expand Down
74 changes: 74 additions & 0 deletions modules/ROOT/pages/errors/gql-errors/42NAF.adoc
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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error: syntax error or access rule violation - not supported local procedure definition. USE clause is not supported in local procedure definitions.
error: syntax error or access rule violation - not supported local procedure definition. The 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::[]
70 changes: 70 additions & 0 deletions modules/ROOT/pages/errors/gql-errors/42NAG.adoc
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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error: syntax error or access rule violation - not supported local function definition. USE clause is not supported in local function definitions.
error: syntax error or access rule violation - not supported local function definition. The USE clause is not supported in local function definitions.


== 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::[]
69 changes: 69 additions & 0 deletions modules/ROOT/pages/errors/gql-errors/42NAH.adoc
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>> }`.
Comment thread
hvub marked this conversation as resolved.
Comment thread
JoelBergstrand marked this conversation as resolved.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error: syntax error or access rule violation - return column error. Return column `{ <<variable>> }` does not match output signature of local procedure `{ <<proc>> }`.
error: syntax error or access rule violation - return column error. Return column `{ <<variable>> }` does not match the output signature of local procedure `{ <<proc>> }`.


== 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::[]
95 changes: 95 additions & 0 deletions modules/ROOT/pages/errors/gql-errors/42NAI.adoc
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>> }`.
Comment thread
JoelBergstrand marked this conversation as resolved.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about something like:

Suggested change
error: syntax error or access rule violation - missing return column. Return column `{ <<variable>> }` is missing to match output signature of local procedure `{ <<proc>> }`.
error: syntax error or access rule violation - missing return column. Return column `{ <<variable>> }` is required to match the output signature of local procedure `{ <<proc>> }`.


== 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::[]
70 changes: 70 additions & 0 deletions modules/ROOT/pages/errors/gql-errors/42NAJ.adoc
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>> }`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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>> }`.
error: syntax error or access rule violation - not supported local procedure output type. `{ <<valueType>> }` is not supported as a local procedure output type. Adjust the type of output field `{ <<variable>> }` of local procedure `{ <<proc>> }`.


== 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::[]
Loading
Loading