FrankChen021 commented on code in PR #20607: URL: https://github.com/apache/druid/pull/20607#discussion_r4306425562
########## docs/querying/sql-query-context.md: ########## @@ -51,6 +51,7 @@ The table below lists the query context parameters you can use with Druid SQL. |`sqlReverseLookup`|Whether to consider the [reverse-lookup rewrite](lookups.md#reverse-lookup) of the `LOOKUP` function during SQL planning.<br /><br />Druid reverses calls to `LOOKUP` only when the number of matching keys is lower than both `inSubQueryThreshold` and `sqlReverseLookupThreshold`.|`true`| |`sqlReverseLookupThreshold`|Maximum size of `IN` filter to create when applying a [reverse-lookup rewrite](lookups.md#reverse-lookup). If a `LOOKUP` call matches more keys than the specified threshold, it remains unchanged.<br /><br />If `inSubQueryThreshold` is lower than `sqlReverseLookupThreshold`, Druid uses `inSubQueryThreshold` threshold instead.|10000| |`sqlPullUpLookup`|Whether to consider the [pull-up rewrite](lookups.md#pull-up) of the `LOOKUP` function during SQL planning.|`true`| +|`sqlTimeCondition`|Time condition to apply to all tables that the query reads. Provide either a comma-separated string of ISO8601 intervals, such as `"2000-01-01/2000-02-01,2001-01-01/2001-02-01"`, or an array of ISO8601 interval strings. An empty array matches nothing. An empty string is an error.<br /><br />Druid ANDs this condition with any other condition you provide on the `__time` column. Intervals without an explicit offset are in UTC; `sqlTimeZone` doesn't affect them.<br /><br />You can't use this parameter with `INSERT`, `REPLACE`, or [catalog DDL](../development/extensions-core/catalog.md#sql-ddl) statements.|none| Review Comment: I also want to know if the supporting of ARRAY is needed. Because under current design, every query context parameter can be set via the `SET` statement, however, the SET statement requires a literal , we CAN'T do sth like this now: ```sql SET sqlTimeCondition = ['a/b', 'c/d']; ``` The only case that current simple String type can't express is the empty array case. But I'm not sure under which case we need to support this case,. If this is a must case, I think maybe we can following existing `SEGMENT_SORT_ORDER` which accepts JSON array inside string, like: ```sql SET sqlTimeCondition = ''; -- error SET sqlTimeCondition = '[]'; -- match nothing SET sqlTimeCondition = '["2000-01-01/2000-02-01","2001-01-01/2001-02-01"]'; SET sqlTimeCondition = '2000-01-01/2000-02-01,2001-01-01/2001-02-01'; ``` -- 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]
