Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling an empty list of versions #16198

Merged
merged 3 commits into from
Mar 26, 2024

Conversation

abhishekrb19
Copy link
Contributor

This patch addresses this review comment by treating null and an empty list of versions differently. An empty collection passed should return no results, rather than ignoring it and returning all results.

Changes

  • Update the condition to handle the null and empty versions differently
  • Clarify javadocs on the behavior of empty versions
  • Add tests for the empty versions in different classes, which would fail without this patch

This PR has:

  • been self-reviewed.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • 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.

Treat them differently so the. Segment IDs and versions can be An empty list,
in which case, the queries should just not return anything. Versions are optional, so
they can be null, which just indicates nothing, so the queries should return segments with
all possible versions. Segment IDs cannot be null as indicated by the absence of @nullable
annotation.
Copy link
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

Thanks for addressing this!

@abhishekrb19 abhishekrb19 merged commit 95595ba into apache:master Mar 26, 2024
85 checks passed
@abhishekrb19 abhishekrb19 deleted the fix_null_empty_checks branch March 26, 2024 00:51
@abhishekrb19
Copy link
Contributor Author

Thanks for the quick review, @kfaraz!

@adarshsanjeev adarshsanjeev added this to the 30.0.0 milestone May 6, 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