Hi Nawaz,

Answering your questions below:

Answer 1:

Sending 200 OK indicates that at least one statement executed successfully. 
This design choice is based on our output handling mechanism.

For example, consider two statements:
1. select 1;
2. create dataverse dv; (where dv already exists)

In this case, when statement 1 executes successfully, its results are 
immediately flushed to the channel along with a 200 OK header.

Due to this architecture and to maintain consistency across different statement 
types, we propose keeping 200 OK as the header status when at least one 
statement executes successfully. Changing this behaviour would require 
significant architectural changes and may not be worth the effort at this time.


Answer 2:
Yes. It serves two purposes: indicating support for multiple statement 
execution and controlling the response format, which depends on whether 
multi-statement is enabled or disabled.
We’ve kept the existing parameter for consistency but are open to suggestions 
for a more descriptive name.

Thanks,
Janhavi


From: Nawazish Khan <nawazish.k...@couchbase.com.INVALID>
Date: Saturday, 12 April 2025 at 5:24 PM
To: dev@asterixdb.apache.org <dev@asterixdb.apache.org>
Subject: Re: [DISCUSS][APE] Proposal for Support Individual Responses for 
Multi-Statement Queries
Hi Janhavi,

A few observations on the multi statement feature:

1. Sending a HTTP 200 status in both successful and partially successful 
scenarios is not explicit and hence might confuse the clients. It might be 
helpful to send 200 only in case if all statements succeeded and HTTP 207 in 
case of partial successful statements. This status scheme would align itself to 
the proposed response object as well which contains metadata on successful 
statements and the single unsuccessful statement.

2. As per the APE, multi-statement flag is used to control the structure of the 
response: array of statement response objects Vs single error object, however, 
the name of the flag – multi-statement – implies if the feature of executing 
multiple statements on the engine is switched on or off; this flag name might 
need a reconsideration.

Sincerely,
MNK



From: Janhavi Tripurwar <janhavi.tripur...@couchbase.com.INVALID>
Date: Friday, 11 April 2025 at 11:34 AM
To: dev@asterixdb.apache.org <dev@asterixdb.apache.org>
Subject: [DISCUSS][APE] Proposal for Support Individual Responses for 
Multi-Statement Queries
Hi All,

Initiating a discussion to propose Support Individual Responses for 
Multi-Statement Queries in AsterixDB.

Feature:  Support Individual Responses for Multi-Statement Queries
Details:  AsterixDB currently returns a single aggregated response for 
multi-statement queries, combining the output, status, and metrics of all 
statements. We need to support individual responses per statement, so each 
statement’s results and execution details are clearly separated. This will 
improve clarity for users and tools consuming the API.


APE: 
https://cwiki.apache.org/confluence/display/ASTERIXDB/APE+20%3A+Support+Individual+Responses+for+Multi-Statement+Queries

Regards,
Janhavi

Reply via email to