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

   ### Description
   
   Boolean query context parameters now accept `true` or `false`, as a Boolean 
or as a string in any case, and `1` or `0`, as an integer or as a string. Any 
other value is rejected with a message that lists the allowed values.
   
   For example, with `SET useCache = <value>`:
   
   | Value | Before this change | After this change |
   |---|---|---|
   | `true`, `'true'`, `'TRUE'` | `true` | `true` |
   | `false`, `'false'`, `'False'` | `false` | `false` |
   | `1` | error: should be a boolean | `true` |
   | `0` | error: should be a boolean | `false` |
   | `'1'` | `false` | `true` |
   | `'0'` | `false` | `false` |
   | `'yes'`, `'no'`, `''` | `false` | error |
   | `1.0`, `2`, `-1` | error: should be a boolean | error |
   
   An invalid value now reports the allowed values:
   
   > Query context parameter [useCache] is boolean, which allows only 0/1, 
'0'/'1', true/false, or 'true'/'false' (in any case), but was given [yes]
   
   #### Release note
   
   Boolean query context parameters accept `1` and `0`, as integers or strings, 
in addition to `true` and `false`. Values other than `true`, `false`, `1` and 
`0` are now rejected; before, any string other than `true` was treated as 
`false`, so `'1'` and `'yes'` meant `false`. This also applies to the `context` 
of the JSON API and to defaults set with `druid.query.default.context.*`, so 
check those for values like `'yes'` or `'no'` before upgrading.
   
   <hr>
   
   ##### Key changed/added classes in this PR
    * `QueryContextParameters`
   
   <hr>
   
   This PR has:
   
   - [x] been self-reviewed.
   - [x] added documentation for new or modified features or behaviors.
   - [x] a release note entry in the PR description.
   - [x] added unit tests or modified existing tests to cover new code paths, 
ensuring the threshold for code coverage is met.
   


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