Error on a subquery CALL

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

I'm not sure about it but I think it's because aliases ( AS ) are not supported inside a subquery.

try removing the colon on the subquery return clause.

2 Likes

Right, I didn't even saw it. I did way too much javascript I guess

1 Like

Gotcha!!! Thank you!

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.

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 :slight_smile: