age
age copied to clipboard
Unexpected Error: argument 1 must not be null
When running the following query:
MERGE () MERGE n0 = ()
I encountered the following error:
pq: argument 1 must not be null
I believe the query mentioned above is semantically and syntactically correct and thus no error should be thrown here. Additionally, the query runs successfully in neo4j.
I encountered this issue when testing queries against the apache/age:PG13_latest docker image.
Steps to reproduce
Run the following query and observe it throws an error:
MERGE () MERGE n0 = ()
Expected behavior
The query should run successfully
Actual behavior
The query fails with the error message argument 1 must not be null
.
Can you share the complete query you are writing along with a screenshot of your terminal for better diagnosis? Also make sure you have imported AGE correctly and you are able to run other queries
The merge syntax is this one:
MERGE (n:Label {property: value})
You must need to enter the vertex details to run the query.
From Documentation, merge is being used in this way
SELECT * FROM cypher('graph_name', $$ MERGE (charlie {name: 'Charlie Sheen', age: 10}) RETURN charlie $$) as (v agtype);
For detailed information, you can see this documentation: Merge Documentation
The issue you are encountering might be due to the differences between Neo4j and Apache AGE. Apache AGE currently does not support all the features and syntax that Neo4j supports.
The MERGE
statement you are trying to run is not specifying any node labels or properties. In Neo4j, MERGE ()
is valid and it matches or creates a node without any labels or properties. However, in Apache AGE, this is not the case.
Have a look at the docs for MERGE
Thanks for looking into this @safi50 and @waleedahmed0001.
However, this doesn't seem like it solves the problem. Removing the n0
identifier in the query lets the query run successfully.
Additionally, adding labels and properties to the two nodes still produces the same error.
It seems like the documentation is out of date, since MERGE ()
is a valid query in the newest release of apache AGE and creates a single node.
@DominicWuest Please test against the master branch, if possible, as it has a lot of updates that haven't been migrated to the other branches.
This issue is stale because it has been open 45 days with no activity. Remove "Abondoned" label or comment or this will be closed in 7 days.
@DominicWuest I believe this is no longer an issue -
psql-16.2-5432-pgsql=# select * from cypher('test', $$ MERGE () MERGE n0 = () $$) as (result agtype); result
--------
(0 rows)
psql-16.2-5432-pgsql=#
Please check against the latest DH releases.
Issue was resolved