maytasm commented on a change in pull request #10856:
URL: https://github.com/apache/druid/pull/10856#discussion_r573519613
##########
File path:
core/src/test/java/org/apache/druid/java/util/common/GranularityTest.java
##########
@@ -809,6 +811,20 @@ public void testIncrementOverSpringForward()
);
}
+ @Test
+ public void testIsFinerComparator()
+ {
+ Assert.assertTrue(Granularity.IS_FINER_THAN.compare(NONE, SECOND) < 0);
+ Assert.assertTrue(Granularity.IS_FINER_THAN.compare(SECOND, NONE) > 0);
+ Assert.assertTrue(Granularity.IS_FINER_THAN.compare(NONE, MINUTE) < 0);
+ Assert.assertTrue(Granularity.IS_FINER_THAN.compare(MINUTE, NONE) > 0);
+ Assert.assertTrue(Granularity.IS_FINER_THAN.compare(DAY, MONTH) < 0);
+ Granularity day = DAY;
Review comment:
nit: why is this a variable?
##########
File path:
core/src/main/java/org/apache/druid/java/util/common/granularity/Granularity.java
##########
@@ -40,6 +41,30 @@
public abstract class Granularity implements Cacheable
{
+
+ /**
Review comment:
nit: is javadoc meant to be on the `compare` method instead of the
`IS_FINER_THAN` variable?
##########
File path:
indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java
##########
@@ -657,16 +649,78 @@ private static DataSchema createDataSchema(
?
createMetricsSpec(queryableIndexAndSegments)
:
convertToCombiningFactories(metricsSpec);
- return new DataSchema(
+ return new
+
+ DataSchema(
dataSource,
- new TimestampSpec(null, null, null),
+ new TimestampSpec(null, null, null
+ ),
Review comment:
nit: remove newline
##########
File path:
core/src/test/java/org/apache/druid/java/util/common/GranularityTest.java
##########
@@ -809,6 +811,20 @@ public void testIncrementOverSpringForward()
);
}
+ @Test
+ public void testIsFinerComparator()
+ {
+ Assert.assertTrue(Granularity.IS_FINER_THAN.compare(NONE, SECOND) < 0);
+ Assert.assertTrue(Granularity.IS_FINER_THAN.compare(SECOND, NONE) > 0);
+ Assert.assertTrue(Granularity.IS_FINER_THAN.compare(NONE, MINUTE) < 0);
+ Assert.assertTrue(Granularity.IS_FINER_THAN.compare(MINUTE, NONE) > 0);
+ Assert.assertTrue(Granularity.IS_FINER_THAN.compare(DAY, MONTH) < 0);
+ Granularity day = DAY;
Review comment:
Can you add
Assert.assertTrue(Granularity.IS_FINER_THAN.compare(NONE, NONE)
Assert.assertTrue(Granularity.IS_FINER_THAN.compare(ALL, ALL)
too?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]