Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-26-2022 04:07 PM
Neo4j Community edition 4.3.3
I have the following minimal query:
LOAD CSV WITH HEADERS
FROM 'file:///xxx.csv'
as rowStore FIELDTERMINATOR ';'
CALL {
WITH rowStore
MATCH (store:Store {uuid: rowStore.uuid})
RETURN store as x;
}
RETURN x;
which returns the following error, that I cannot explain. I simplified the query to its minimal, but still cannot understand:
Neo.ClientError.Statement.SyntaxError: Invalid input '': expected
","
"CALL"
"CREATE"
"DELETE"
"DETACH"
"FOREACH"
"LIMIT"
"LOAD"
"MATCH"
"MERGE"
"OPTIONAL"
"ORDER"
"REMOVE"
"RETURN"
"SET"
"SKIP"
"UNION"
"UNWIND"
"USE"
"WITH"
"}" (line 8, column 21 (offset: 211))
" RETURN store as x"
^
} RETURN x
Solved! Go to Solution.
02-26-2022 07:22 PM
02-26-2022 05:27 PM
I'm not sure about it but I think it's because aliases ( AS ) are not supported inside a subquery.
02-26-2022 07:22 PM
try removing the colon on the subquery return clause.
02-27-2022 12:37 AM
Right, I didn't even saw it. I did way too much javascript I guess
02-27-2022 08:07 AM
Gotcha!!! Thank you!
02-27-2022 06:08 PM
By the way, I double checked the doc about sub queries and yes there are some limitations about it but you can safely use AS in the return of a sub query.
02-28-2022 12:00 AM
Apart of javascript (and in the latest versions it's more intelligent about delimiters), I remember that in cypher
return is always been followed by a semicolon
All the sessions of the conference are now available online