AmatyaAvadhanula commented on code in PR #16324:
URL: https://github.com/apache/druid/pull/16324#discussion_r1576828104
##########
server/src/main/java/org/apache/druid/segment/indexing/granularity/UniformGranularitySpec.java:
##########
@@ -45,6 +47,15 @@ public UniformGranularitySpec(
super(inputIntervals, rollup);
this.queryGranularity = queryGranularity == null ?
DEFAULT_QUERY_GRANULARITY : queryGranularity;
this.segmentGranularity = segmentGranularity == null ?
DEFAULT_SEGMENT_GRANULARITY : segmentGranularity;
+ if (Granularity.IS_FINER_THAN.compare(this.segmentGranularity,
this.queryGranularity) < 0) {
+ throw DruidException.forPersona(DruidException.Persona.USER)
+ .ofCategory(DruidException.Category.UNSUPPORTED)
+ .build(
+ "SegmentGranularity[%s] must not be finer than
QueryGranularity[%s].",
+ this.segmentGranularity,
+ this.queryGranularity
+ );
Review Comment:
Done.
As for the capitalization, the string representation of Granularities.SECOND
is not `SECOND`. It is `{type=period, period=PT1S, timeZone=UTC, origin=null}`.
##########
server/src/test/java/org/apache/druid/segment/indexing/granularity/UniformGranularityTest.java:
##########
@@ -358,6 +359,18 @@ public void
testUniformGranularitySpecWithLargeNumberOfIntervalsDoesNotBlowUp()
Assert.assertEquals(3600 * 24 * 365 * 10 + 3 * 24 * 3600, count);
}
+ @Test(expected = DruidException.class)
Review Comment:
Done, thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]