clintropolis opened a new pull request, #17894:
URL: https://github.com/apache/druid/pull/17894

   ### Description
   This PR allows HTTP SQL requests to optionally include multiple `SET` 
statements to build up context for a final statement. For example given a 
`query` string of the request that looks like:
   
   ```SQL
   SET timeout = 20000;
   SET useCache = false;
   SET populateCache = false;
   SET vectorize = 'force';
   SELECT "channel", "page", sum("added") from "wikipedia" GROUP BY 1, 2
   ```
   upon parsing the changes in this PR would expectedly include `timeout`, 
`useCache`, `populateCache`, and `vectorize` in the query context of the issued 
query. This provides an optional, alternative way to specify query context 
directly via SQL by effectively treating the HTTP request as a single complete 
session. 
   
   This also works for MSQ queries as well, including insert and replace.
   
   This is only allowed for HTTP requests using `HttpStatement` internally in 
the code. JDBC `DirectStatement` and `PreparedStatement` do not allow these 
multi-part statements, and will fail to parse such queries.
   
   #### Release note
   (approx copy from description)
   
   SQL requests to optionally include multiple `SET` statements to build up 
context for a final statement. For example given a `query` string of the 
request that looks like:
   
   ```SQL
   SET timeout = 20000;
   SET useCache = false;
   SET populateCache = false;
   SET vectorize = 'force';
   SELECT "channel", "page", sum("added") from "wikipedia" GROUP BY 1, 2
   ```
   upon parsing the changes in this PR would expectedly include `timeout`, 
`useCache`, `populateCache`, and `vectorize` in the query context of the issued 
query. This provides an optional, alternative way to specify query context 
directly via SQL by effectively treating the HTTP request as a single complete 
session. 
   
   This also works for MSQ queries as well, including insert and replace.
   
   This is only allowed for HTTP requests. JDBC does not allow these multi-part 
statements, and will fail to parse such queries.
   
   <hr>
   
   This PR has:
   
   - [ ] been self-reviewed.
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] a release note entry in the PR description.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked 
related entities via Javadoc links.
   - [x] added comments explaining the "why" and the intent of the code 
wherever would not be obvious for an unfamiliar reader.
   - [x] added unit tests or modified existing tests to cover new code paths, 
ensuring the threshold for [code 
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
 is met.
   - [ ] added integration tests.
   - [x] been tested in a test Druid cluster.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to