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

Propagate Intervals.of() error message to user #15454

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

rash67
Copy link
Contributor

@rash67 rash67 commented Nov 29, 2023

Description

In SQL, when specifying an interval, eg '2020-01-01T:00:00:00Z/2021-01-01T00:00:00Z', errors in the string are not shown to the user. It gives an unknown error and no useful information.

This propagates any errors from Intervals.of() properly by catching and throwing the proper exception

Release note

-Improve error message on interval construction in SQL statements

  • been self-reviewed.
  • 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.
  • 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.

@rash67 rash67 force-pushed the interval-error-message branch 3 times, most recently from e0a0047 to 908a3d9 Compare December 13, 2023 23:32
@rash67
Copy link
Contributor Author

rash67 commented Dec 14, 2023

This broke some unit tests that expected IllegalArgumentException. I updated so they expect DruidException with a proper category and all checks pass

@rash67 rash67 force-pushed the interval-error-message branch 2 times, most recently from 69374cf to a3fc2f3 Compare December 14, 2023 21:41
@rash67 rash67 force-pushed the interval-error-message branch 3 times, most recently from e714049 to b0464de Compare January 5, 2024 02:59

EasyMock.verify(overlordClient, server);
DruidExceptionMatcher.invalidInput().assertThrowsAndMatches(
() -> dataSourcesResource.markAsUnusedAllSegmentsOrKillUnusedSegmentsInInterval("datasource", "true", "???", request)

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
DataSourcesResource.markAsUnusedAllSegmentsOrKillUnusedSegmentsInInterval
should be avoided because it has been deprecated.
@cheddar cheddar merged commit 072b16c into apache:master Jan 16, 2024
83 checks passed
@LakshSingla LakshSingla added this to the 29.0.0 milestone Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants