clintropolis opened a new pull request, #13885:
URL: https://github.com/apache/druid/pull/13885
### Description
This PR relaxes multi-value string usage consistency validation to allow
expressions like `nvl`, `isnull`, `notnull`, case and if statements, etc, to no
longer automatically assume that their inputs must be scalar arguments.
This validation was added way back in #7588 as a means to ensure that a
multi-value string column was being used consistently within an expression so
that it cannot be considered both as an array and as a scalar value (which must
be mapped across the multiple values). This system basically divided
expressions up into expressions that definitely take array inputs and output
arrays, and everything else. This worked well enough for lots of expressions,
but a small handful don't fit this model, which is what this PR aims to help
fix.
This system predates the native expression layer having full type inference,
and I think it could be done a lot better, so I am also going to be trying to
merge this much older analysis system into the type inference system in a
follow-up PR, since all of the analysis of contextual usage and validation can
be done at the same places where we doing the newer stuff (expression planner,
etc).
While here I also consolidated some calcite -> native druid type stuff for
the cast operator, which allowed some additional expressions to plan correctly.
<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]