clintropolis opened a new pull request, #18078:
URL: https://github.com/apache/druid/pull/18078
### Description
changes:
* the cast expression will now be more lenient when casting arrays of
primitive values. Previously single element arrays were allowed to be cast to
scalar values, and more than 1 element would result in a type cast exception.
Casting multi-element arrays will now create a null value in the target type
instead of failing to be more consistent with other primitive value behavior,
which return null if the cast cannot be completed. Complex value casting will
still throw type cast exceptions.
* NestedFieldVirtualColumn has been simplified, removing many of its own
selector implementations with built in casting in favor of delegating casts to
expression selectors when casts are required
* fix several places in NestedFieldVirtualColumn which would allow creating
selectors that were not consistent with the expected output type of the virtual
column, leading to inconsistent query results depending on what kind of
selector was created for the underlying field.
* NestedFieldVirtualColumn now uses JSON_VALUE and JSON_QUERY expressions
when no underlying json columns are available to optimize (e.g. when using
realtime queries), these selectors were very similar
* Adjusted test data to cover more of the inconsistencies and fixed tests
which were encoding incorrect behavior
#### Release note
_tbd_
<hr>
This PR has:
- [ ] been self-reviewed.
- [ ] using the [concurrency
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
(Remove this item if the PR doesn't have any relation to concurrency.)
- [ ] 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.
- [ ] added or updated version, license, or notice information in
[licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
- [ ] added comments explaining the "why" and the intent of the code
wherever would not be obvious for an unfamiliar reader.
- [ ] 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.
- [ ] 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]