vtlim commented on code in PR #18027: URL: https://github.com/apache/druid/pull/18027#discussion_r2112581296
########## docs/api-reference/sql-api.md: ########## @@ -195,6 +200,20 @@ Content-Length: 192 </TabItem> </Tabs> +You can also specify query-level context parameters directly within the SQL query string using the `SET` command. For more details on `SET` statements, see [SET statements](../querying/sql.md#set-statements). + +The following functionally equivalent JSON object uses `SET` command for `sqlQueryId` directly in the query: Review Comment: ```suggestion The following request body is functionally equivalent to the previous example and uses `SET` instead of the `context` parameter: ``` ########## docs/api-reference/sql-api.md: ########## @@ -195,6 +200,20 @@ Content-Length: 192 </TabItem> </Tabs> +You can also specify query-level context parameters directly within the SQL query string using the `SET` command. For more details on `SET` statements, see [SET statements](../querying/sql.md#set-statements). Review Comment: ```suggestion You can also specify query-level context parameters directly within the SQL query string using the `SET` command. For more details, see [SET statements](../querying/sql.md#set-statements). ``` ########## docs/api-reference/sql-ingestion-api.md: ########## @@ -100,7 +100,10 @@ The `/druid/v2/sql/task` endpoint accepts the following: ### Sample request -The following example shows a query that fetches data from an external JSON source and inserts it into a table named `wikipedia`. +The following example shows a query that fetches data from an external JSON source and inserts it into a table named `wikipedia`.It specifies two special settings directly in the query before inserting the data: Review Comment: ```suggestion The following example shows a query that fetches data from an external JSON source and inserts it into a table named `wikipedia`. It specifies two query context parameters: ``` ########## docs/api-reference/sql-api.md: ########## @@ -154,7 +154,12 @@ If you detect a truncated response, treat it as an error. #### Sample request -The following example retrieves all rows in the `wikipedia` datasource where the `user` is `BlueMoon2662`. The query is assigned the ID `request01` using the `sqlQueryId` context parameter. The optional properties `header`, `typesHeader`, and `sqlTypesHeader` are set to `true` to include type information to the response. +This sample request demonstrates the following actions: +- This query retrieves all rows from the `wikipedia` datasource. +- This query also filters the results where the `user` value is `BlueMoon2662`. +- The `sqlTimeZone` context parameter sets the query's time zone to `America/Los_Angeles` +- This response also set its `header`, `typesHeader`, and `sqlTypesHeader` properties as `true`. Review Comment: ```suggestion - The query results also include descriptors for `header`, `typesHeader`, and `sqlTypesHeader`. ``` ########## docs/multi-stage-query/examples.md: ########## @@ -32,7 +32,7 @@ sidebar_label: Examples These example queries show you some of the things you can do when modifying queries for your use case. Copy the example queries into the **Query** view of the web console and run them to see what they do. :::tip -When you insert or replace data with SQL-based ingestion, set the context parameter `finalizeAggregations` to `false`. This context parameter is automatically set for you if you use the Druid console. If you use the API, you must explicitly set it. For more information, see [Rollup](./concepts.md#rollup). +When you insert or replace data with SQL-based ingestion, set the context parameter `finalizeAggregations` to `false`. This context parameter is automatically set for you if you use the Druid console. If you use the API, you must explicitly set it. For an example on how to set up this, see this [SQL API Sample Request](../api-reference/sql-ingestion-api#sample-request). For more information about Rollup, see [Rollup](./concepts.md#rollup). Review Comment: ```suggestion When you insert or replace data with SQL-based ingestion, set the context parameter `finalizeAggregations` to `false`. This context parameter is automatically set for you if you use the Druid console. If you use the API, you must explicitly set it. For an example, see [SQL-based ingestion API](../api-reference/sql-ingestion-api#sample-request). For details on aggregations, see [Rollup](./concepts.md#rollup). ``` ########## docs/api-reference/sql-api.md: ########## @@ -154,7 +154,12 @@ If you detect a truncated response, treat it as an error. #### Sample request -The following example retrieves all rows in the `wikipedia` datasource where the `user` is `BlueMoon2662`. The query is assigned the ID `request01` using the `sqlQueryId` context parameter. The optional properties `header`, `typesHeader`, and `sqlTypesHeader` are set to `true` to include type information to the response. +This sample request demonstrates the following actions: +- This query retrieves all rows from the `wikipedia` datasource. +- This query also filters the results where the `user` value is `BlueMoon2662`. +- The `sqlTimeZone` context parameter sets the query's time zone to `America/Los_Angeles` Review Comment: ```suggestion - The `sqlTimeZone` context parameter sets the time zone to `America/Los_Angeles` for query results. ``` -- 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]
