Repository navigation
Closed
Milestone
Description
ArcadeDB Version:
ArcadeDB Server v24.6.1-SNAPSHOT (build 6ff2d86d488fe6b3ca20f7a6554160d6017af118/1716919859476/main)
OS and JDK Version:
Running on Mac OS X 12.7.5 - OpenJDK 64-Bit Server VM 17.0.11 (Homebrew)
Using a parameter in POST request query where the parameter specifies a bucket name errors. This is maybe because the double colon, ie BUCKET::param cannot be parsed?
Expected behavior
Succesful query in bucket
Actual behavior
Error on command execution
<ArcadeDB_0> Error on command execution (PostQueryHandler)
com.arcadedb.exception.CommandSQLParsingException: SELECT FROM BUCKET::myparam limit 20000
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:216)
at com.arcadedb.query.sql.SQLQueryEngine.query(SQLQueryEngine.java:80)
at com.arcadedb.database.LocalDatabase.query(LocalDatabase.java:1378)
at com.arcadedb.server.ServerDatabase.query(ServerDatabase.java:494)
at com.arcadedb.server.http.handler.PostQueryHandler.executeCommand(PostQueryHandler.java:38)
at com.arcadedb.server.http.handler.PostCommandHandler.execute(PostCommandHandler.java:113)
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 <FROM> "FROM" at line 1, column 8.
Was expecting one of:
<DISTINCT> ...
<DISTINCT> ...
<DISTINCT> ...
<DISTINCT> ...
<DISTINCT> ...
<DISTINCT> ...
<DISTINCT> ...
<DISTINCT> ...
<DISTINCT> ...
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.Projection(SqlParser.java:4892)
at com.arcadedb.query.sql.parser.SqlParser.SelectWithoutTargetStatement(SqlParser.java:1548)
at com.arcadedb.query.sql.parser.SqlParser.QueryStatement(SqlParser.java:1497)
at com.arcadedb.query.sql.parser.SqlParser.StatementInternal(SqlParser.java:1287)
at com.arcadedb.query.sql.parser.SqlParser.Statement(SqlParser.java:1055)
at com.arcadedb.query.sql.parser.SqlParser.Parse(SqlParser.java:251)
at com.arcadedb.query.sql.parser.StatementCache.parse(StatementCache.java:111)
... 16 more
Steps to reproduce
CREATE DOCUMENT TYPE doc BUCKET mybucketwget -qO- http://localhost:2480/api/v1/query/test --post-data='{"language":"sql","params":{"myparam":"mybucket"},"command":"SELECT FROM BUCKET::myparam"}' --user root --password arcadedb
Activity
lvca commentedon Jun 5, 2024
It should be
BUCKET:myparamgramian commentedon Jun 5, 2024
Using `BUCKET:myparam` also errors
since then the parameter is not identified as such.
lvca commentedon Jun 5, 2024
Sorry, I didn't notice the parameter. Correct, you can't use parameters there.
gramian commentedon Jun 5, 2024
Too bad. So, does this bug report become a feature request or is this too unlikely to be implemented and should hence be closed?
gramian commentedon Jun 5, 2024
Hmm, so I tried using
which errors, but
works. So can you describe what the syntactic rule is, so I can add it to the docs?
lvca commentedon Jun 5, 2024
If it works without the
BUCKET:prefix, then it should be easy to implement it. I'm ok with this as an enhancement.feat: SQL -> support for bucket name as parameter
lvca commentedon Jan 22, 2026
Now you can use:
New SQL parser using ANTLR4 replacing of JavaCC (#3195)
gramian commentedon Jan 24, 2026
Works for me. Cool, thanks!
New SQL parser using ANTLR4 replacing of JavaCC (#3195)
New SQL parser using ANTLR4 replacing of JavaCC (ArcadeData#3195)
build(deps): bump the github-actions group with 2 updates [skip ci]