Skip to content

HTTP/SQL: "params" cannot be bucket names #1625

Closed

Description

@gramian

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 mybucket
wget -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

  1. lvca commented on Jun 5, 2024

    @lvca
    Member

    It should be BUCKET:myparam

  2. self-assigned this
    on Jun 5, 2024
  3. gramian commented on Jun 5, 2024

    @gramian
    CollaboratorAuthor
    Using `BUCKET:myparam` also errors
    <ArcadeDB_0> Error on command execution (PostQueryHandler)
    com.arcadedb.exception.SchemaException: Bucket with name 'myparam' was not found
    	at com.arcadedb.schema.LocalSchema.getBucketByName(LocalSchema.java:281)
    	at com.arcadedb.query.sql.executor.SelectExecutionPlanner.handleClustersAsTarget(SelectExecutionPlanner.java:2196)
    	at com.arcadedb.query.sql.executor.SelectExecutionPlanner.handleFetchFromTarget(SelectExecutionPlanner.java:780)
    	at com.arcadedb.query.sql.executor.SelectExecutionPlanner.createExecutionPlan(SelectExecutionPlanner.java:144)
    	at com.arcadedb.query.sql.parser.SelectStatement.createExecutionPlan(SelectStatement.java:208)
    	at com.arcadedb.query.sql.parser.SelectStatement.execute(SelectStatement.java:201)
    	at com.arcadedb.query.sql.parser.Statement.execute(Statement.java:85)
    	at com.arcadedb.query.sql.parser.Statement.execute(Statement.java:69)
    	at com.arcadedb.query.sql.SQLQueryEngine.query(SQLQueryEngine.java:85)
    	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)
    

    since then the parameter is not identified as such.

  4. lvca commented on Jun 5, 2024

    @lvca
    Member

    Sorry, I didn't notice the parameter. Correct, you can't use parameters there.

  5. gramian commented on Jun 5, 2024

    @gramian
    CollaboratorAuthor

    Too bad. So, does this bug report become a feature request or is this too unlikely to be implemented and should hence be closed?

  6. gramian commented on Jun 5, 2024

    @gramian
    CollaboratorAuthor

    Hmm, so I tried using

    wget -qO- http://localhost:2480/api/v1/query/test --post-data='{"language":"sql","params":{"myparam":"BUCKET:mybucket"},"command":"SELECT FROM :myparam"}' --user root --password arcadedb
    

    which errors, but

    wget -qO- http://localhost:2480/api/v1/query/test --post-data='{"language":"sql","params":{"myparam":"doc"},"command":"SELECT FROM :myparam"}' --user root --password arcadedb
    

    works. So can you describe what the syntactic rule is, so I can add it to the docs?

  7. lvca commented on Jun 5, 2024

    @lvca
    Member

    If it works without the BUCKET: prefix, then it should be easy to implement it. I'm ok with this as an enhancement.

  8. added this to the 26.2.1 milestone on Jan 22, 2026
  9. added theissue type on Jan 22, 2026
  10. added
    in progressThe team is actively working on this issue
    on Jan 22, 2026
  11. lvca commented on Jan 22, 2026

    @lvca
    Member

    Now you can use:

    1. Named parameters: bucket::paramName (e.g., SELECT FROM bucket::bucketName)
    2. Positional parameters: bucket:? (e.g., SELECT FROM bucket:?)
  12. added and removed
    in progressThe team is actively working on this issue
    on Jan 22, 2026
  13. gramian commented on Jan 24, 2026

    @gramian
    CollaboratorAuthor

    Works for me. Cool, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions