Skip to content

fix bugs with multi-value string array expression handling#12244

Closed
clintropolis wants to merge 3 commits intoapache:masterfrom
clintropolis:multi-value-string-array-expression-fixes
Closed

fix bugs with multi-value string array expression handling#12244
clintropolis wants to merge 3 commits intoapache:masterfrom
clintropolis:multi-value-string-array-expression-fixes

Conversation

@clintropolis
Copy link
Copy Markdown
Member

Description

Split out bug fixes from #12241 in case that PR is too noisy. This PR fixes some issues uncovered while working on that other PR, related to null coercion with multi-value string array expressions, similar to the bugs fixed #12078 (and controlled by the flag #12210)

This fix exists entirely within that other PR, though there is a subtle difference between the output of CalciteMultiValueStringQueryTest.testMultiValueListFilterComposed due to differences in behavior between the falllback filter expression and the native ListFilteredVirtualColumn (filter produces 0 length arrays for rows which do not match, while ListFilteredVirtualColumn considers these values as null which is consistent with the behavior of other multi-value string dimension selectors).

Should the other PR be merged before this one, this can be closed (and likewise will fix up the other PR should this one be merged first).


This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • 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.
  • 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.

if (row.size() == 0) {
return new Object[]{null};
if (row.size() == 0 || (row.size() == 1 && selector.getObject() == null)) {
if (homogenize) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe I am overthinking but does it make sense to take out this branch and return a different supplier itself? Might be unnecessary if this method is not very hot.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eh, it is a hot path, though probably not the worst thing happening in non-vectorized expressions, so an extra branch probably doesn't do that much heh

that said, I think these input binding suppliers are probably worth thinking about either optimizing with additional specialized implementations, or at least using as an example of what not to do when we add multi-value string and array support for vectorized expressions.

@clintropolis
Copy link
Copy Markdown
Member Author

closing in favor of #12241

@clintropolis clintropolis deleted the multi-value-string-array-expression-fixes branch February 26, 2022 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants