Array overlap to allow numeric operand
Description
Allow ARRAY_OVERLAP operator to take numeric value as input Allow null & double values as elements of array passed as sql parameter
Release note
Key changed/added classes in this PR
ArrayOverlapOperatorConversionSqlParameterizerShuttleCalciteArraysQueryTest
This PR has:
- [x] been self-reviewed.
- [ ] using the concurrency checklist (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
- [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
- [x] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
- [ ] added integration tests.
- [ ] been tested in a test Druid cluster.
i think the only hesitation i have here is it feels odd that this is the only array function that allows numeric inputs, i wonder if we should just allow them all to accept any input since at the native layer we allow the array functions to work with anything, if it isn't already and array we make it a single element array. This is largely done to make stuff work with schema evolution, and also mvds fit this pattern, but SQL is currently more restrictive.. and probably shouldn't have allowed VARCHAR either if we werent going to allow ANY to be symmetrical with the native layer.
Need to think about it a bit.
IMO, rather than expanding the ARRAY functions to accept various kinds of scalars in array context, it's better to introduce a new function that explicitly accepts a scalar + an array. You're doing that already in #16306, so perhaps we can close this one?