arcadedb icon indicating copy to clipboard operation
arcadedb copied to clipboard

SQL: Concatenation of arrays with nested projections

Open gramian opened this issue 2 years ago • 0 comments

ArcadeDB Version:

ArcadeDB Server v23.12.1-SNAPSHOT (build 8d9583b62ab9c057dc3623f4e895348d2277a97b/1701362292401/main)

OS and JDK Version:

Running on Mac OS X 12.7 - OpenJDK 64-Bit Server VM 17.0.9 (Homebrew)

The concatenation of arrays fails where one argument contains a nested projection:

Expected behavior

[{"x":1}]

Actual behavior

Cannot execute command Encountered "||"
Error on command execution (PostCommandHandler)
com.arcadedb.exception.CommandSQLParsingException: SELECT list({"x":1}):{x} || [] limit 25
	at com.arcadedb.query.sql.parser.StatementCache.throwParsingException(StatementCache.java:126)
	at com.arcadedb.query.sql.parser.StatementCache.parse(StatementCache.java:116)
	at com.arcadedb.query.sql.parser.StatementCache.get(StatementCache.java:70)
	at com.arcadedb.query.sql.SQLQueryEngine.parse(SQLQueryEngine.java:208)
	at com.arcadedb.query.sql.SQLQueryEngine.command(SQLQueryEngine.java:97)
	at com.arcadedb.database.LocalDatabase.command(LocalDatabase.java:1335)
	at com.arcadedb.server.ServerDatabase.command(ServerDatabase.java:467)
	at com.arcadedb.server.http.handler.PostCommandHandler.executeCommand(PostCommandHandler.java:131)
	at com.arcadedb.server.http.handler.PostCommandHandler.execute(PostCommandHandler.java:110)
	at com.arcadedb.server.http.handler.DatabaseAbstractHandler.execute(DatabaseAbstractHandler.java:99)
	at com.arcadedb.server.http.handler.AbstractServerHttpHandler.handleRequest(AbstractServerHttpHandler.java:127)
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:393)
	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859)
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
	at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: com.arcadedb.query.sql.parser.ParseException: Encountered "||" "||" at line 1, column 26.
Was expecting one of:
    <EOF> 
    <LIMIT> ...
    <SKIP2> ...
    <OFFSET> ...
    <TIMEOUT> ...
    <AS> ...
    <LET> ...
    <UNWIND> ...
    ";" ...
    "," ...
    <AS> ...
    "," ...
    <AS> ...
    
	at com.arcadedb.query.sql.parser.SqlParser.generateParseException(SqlParser.java:27535)
	at com.arcadedb.query.sql.parser.SqlParser.jj_consume_token(SqlParser.java:27380)
	at com.arcadedb.query.sql.parser.SqlParser.Parse(SqlParser.java:253)
	at com.arcadedb.query.sql.parser.StatementCache.parse(StatementCache.java:111)
	... 16 more

Steps to reproduce

SELECT list({"x":1}):{x} || []

gramian avatar Dec 05 '23 18:12 gramian