Add support for "RETURN *"

Right now, the following query results in an error:

MATCH (p:Person)
RETURN *

Most of the time, you explicitly specify the variables in the RETURN statement anyway.
On the other when doing ad-hoc queries “RETURN *” may be used quite often.

Hi gruby_karol, thanks for the openCypher feature request. We will add this to our roadmap.

2 Likes

Hi @gruby_karol , we just added RETURN * to the tool at: https://opencypher.tigergraph.com:14240/playground . Please try it out.

Not quite there, yet :wink:

See below.

This one works fine:

MATCH (p:Person)-[r]-(m:Movie)
RETURN p.name, r

The following equivalent fails:

MATCH (p:Person)-[r]-(m:Movie)
RETURN *

And returns null.

In general, it looks like returning a relation variable with ‘*’ needs some work.

Additional interesting case. Let’s add a relation type to the query:

MATCH (p:Person)-[r:ACTED_IN]->(m:Movie)
RETURN *

This one fails in a surprising way:

line 3:83 extraneous input '<' expecting {BOOL, DATETIME, DOUBLE, EDGE, FLOAT, INT, JSONARRAY, JSONOBJECT, STRING, UINT, VERTEX} line 3:97 mismatched input ',' expecting ';' line 3:116 extraneous input 'string' expecting {ABORT, BY, COMMIT, DISTINCT, FILE, GROUP, INSERT, LASTHOP, LIST, LOG, MAP, MATCH, NOW, PATH, PER, REPLACE, SRC, TGT, TO_DATETIME, UPDATE, NAME} line 3:130 extraneous input 'uint' expecting {ABORT, BY, COMMIT, DISTINCT, FILE, GROUP, INSERT, LASTHOP, LIST, LOG, MAP, MATCH, NOW, PATH, PER, REPLACE, SRC, TGT, TO_DATETIME, UPDATE, NAME} line 3:145 extraneous input 'string' expecting {ABORT, BY, COMMIT, DISTINCT, FILE, GROUP, INSERT, LASTHOP, LIST, LOG, MAP, MATCH, NOW, PATH, PER, REPLACE, SRC, TGT, TO_DATETIME, UPDATE, NAME} line 3:159 extraneous input '>' expecting {',', ';'} Parsing encountered 6 syntax error(s) Semantic Check Fails: Fail to generate the query list because of a query syntex error. Semantic Check Fails: The data file in the JSONObject format for an interpret query is invalid. Please refer to log.ERROR for details.

When you take a look at the query generated from cypher, there is no ‘<’ character at all…

CREATE OR REPLACE QUERY generated_query() FOR GRAPH openCypher_Movie SYNTAX V3 {

	SELECT * INTO T
	FROM   (p:Person)-[r:ACTED_IN]->(m:Movie);

	PRINT T;
}

Hope this helps.

P.S.
Is there a TG version available with openCypher support for download? I could do some experimenting on my laptop, then.

Hi @gruby_karol ,
Thanks for your feedback for our work-in-progress openCypher support development. This info has been passed to our developer team.
Unfortunately, we don’t have a this feature in a downloadable form yet. The dev team is working hard to add the initial openCypher support into our production release towards of end of this year or early next year. In the meantime, the best way for you to try the latest and provide valuable feedbacks is via this playground tool.

Thanks!

The work you are doing here is much appreciated.

Hi @gruby_karol ,
Please try the latest in the playground. It should be addressed.
Thanks!

Thanks. The cases I’ve tested work fine.
I’ll try to find another problem :wink: