paul-rogers opened a new pull request, #12634:
URL: https://github.com/apache/druid/pull/12634

   This is a subset of the changes for the [planner test 
framework](https://github.com/apache/druid/pull/12545), split out to make 
reviews easier.
   
   Druid native queries are often serialized to JSON. In the planner framework, 
we save the JSON as an "expected plan." To make the resulting files a bit 
smaller, this PR removes from the JSON those fields with default values: values 
that Jackson would infer even if the fields are not present. For example, 
rather than spelling out `"foo": null`, we can simply omit `"foo"` and get the 
same results. The same is true for `"foo": {}` and `"foo": []` since most 
constructors will create an empty collection if passed a null.
   
   The clean-up is done using the `@JsonInclude` annotation, sometimes with a 
custom filter class. Scan Query has a batch size which defaults to `4096 * 5` 
if the provided value is 0. Given this, added a filter which omits the value if 
it is the default, which avoids cluttering the deserialized JSON with magic 
numbers.
   
   Some unit tests check for an exact serialization of the JSON, including the 
now-removed `null` fields. All such tests were updated with the revised format.
   
   This change is purely cosmetic: the deserialized query objects do not change 
meaning. Tested via unit tests, including the new planner test framework.
   
   <hr>
   
   This PR has:
   - [X] been self-reviewed.
   - [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.
   - [ ] 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