Skip to content

fix unnest bugs#16723

Merged
clintropolis merged 16 commits intoapache:masterfrom
clintropolis:fix-unnest-adapter-capabilities-more-alternate
Jul 11, 2024
Merged

fix unnest bugs#16723
clintropolis merged 16 commits intoapache:masterfrom
clintropolis:fix-unnest-adapter-capabilities-more-alternate

Conversation

@clintropolis
Copy link
Member

@clintropolis clintropolis commented Jul 11, 2024

Description

Fixes of #16690, but tries to instead fix the attempted behavior of coercing [] into [null] for UnnestDimensionCursor to be less disruptive while we determine what the correct behavior for unnest on [] for a multi-value string actually is. For regular arrays, [] is skipped per the standard, but for MVDs it looks like the UnnestDimensionCursor was trying to match group-by behavior. Idk if matching group-by behavior is correct, but the way it was doing it was totally wrong if null wasn't id 0 in the dictionary (or if the dictionary had no nulls at all). This PR fixes that by using the idLookup of the underlying dimension selector to lookup the null value id, and if present, using that, and if not, creating a synthetic nullId at position 0 and offsetting all of the real dictionary ids by 1 as we have done in some other places for other reasons (e.g. adapters for default value mode when segments were written in SQL compatible null handling mode).


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 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.
  • been tested in a test Druid cluster.

@clintropolis clintropolis changed the title Fix unnest adapter capabilities more alternate fix unnest bugs Jul 11, 2024
@clintropolis clintropolis mentioned this pull request Jul 11, 2024
@clintropolis clintropolis merged commit b3c2384 into apache:master Jul 11, 2024
@clintropolis clintropolis deleted the fix-unnest-adapter-capabilities-more-alternate branch July 11, 2024 20:48
sreemanamala pushed a commit to sreemanamala/druid that referenced this pull request Aug 6, 2024
changes:
* fixes a bug with unnest storage adapter not preserving underlying columns dictionary uniqueness when allowing dimension selector cursor
* fixes a bug with unnest on realtime segments with empty rows incorrectly specifying index 0 as the row dictionary value
@kfaraz kfaraz added this to the 31.0.0 milestone Oct 4, 2024
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.

3 participants