Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL: Nested Projection Problem #1591

Closed
gramian opened this issue May 10, 2024 · 1 comment
Closed

SQL: Nested Projection Problem #1591

gramian opened this issue May 10, 2024 · 1 comment

Comments

@gramian
Copy link
Collaborator

gramian commented May 10, 2024

ArcadeDB Version:

ArcadeDB Server v24.5.1-SNAPSHOT (build 7872d1acb3616c2866613dabcb7d899322bb3348/1715204385992/main)

OS and JDK Version:

Running on Mac OS X 12.7.4 - OpenJDK 64-Bit Server VM 17.0.11 (Homebrew)

The result of a nested projection produces errors if attempted to process it further. Similarly a nested projection seems not to be allowed inside a LET.

Expected behavior

[{"test":1}]

Actual behavior

Cannot execute command Encountered
Error on command execution (PostCommandHandler)
Exception on parsing the following SQL command: SELECT [{}]:{1 AS test} || [] limit 25;
com.arcadedb.exception.CommandSQLParsingException: com.arcadedb.query.sql.parser.ParseException: Encountered <SELECT> "SELECT" at line 1, column 1.
Was expecting one of:
    <WHILE> ...
    <IF> ...
    <FOREACH> ...
    ";" ...
    
	at com.arcadedb.query.sql.SQLScriptQueryEngine.parseScript(SQLScriptQueryEngine.java:149)
	at com.arcadedb.query.sql.SQLScriptQueryEngine.command(SQLScriptQueryEngine.java:102)
	at com.arcadedb.database.LocalDatabase.command(LocalDatabase.java:1348)
	at com.arcadedb.server.ServerDatabase.command(ServerDatabase.java:472)
	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:100)
	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 <SELECT> "SELECT" at line 1, column 1.
Was expecting one of:
    <WHILE> ...
    <IF> ...
    <FOREACH> ...
    ";" ...
    
	at com.arcadedb.query.sql.parser.SqlParser.generateParseException(SqlParser.java:27774)
	at com.arcadedb.query.sql.parser.SqlParser.jj_consume_token(SqlParser.java:27619)
	at com.arcadedb.query.sql.parser.SqlParser.ParseScript(SqlParser.java:510)
	at com.arcadedb.query.sql.SQLScriptQueryEngine.parseScript(SQLScriptQueryEngine.java:147)
	... 14 more

Steps to reproduce

SELECT [{}]:{1 AS test} || []
SELECT $a LET $a = [{}]:{1 AS test}

Notably:

SELECT [] || [{}]:{1 AS test}

works, so I think it could be related to the grammar?

@gramian
Copy link
Collaborator Author

gramian commented May 18, 2024

Duplicate of #1367

@gramian gramian marked this as a duplicate of #1367 May 18, 2024
@gramian gramian closed this as completed May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant