kfaraz commented on a change in pull request #12046:
URL: https://github.com/apache/druid/pull/12046#discussion_r766080791
##########
File path:
core/src/main/java/org/apache/druid/timeline/partition/DimensionRangeShardSpec.java
##########
@@ -145,29 +141,58 @@ private static ShardSpecLookup createLookup(List<?
extends ShardSpec> shardSpecs
return Collections.unmodifiableList(dimensions);
}
- private Range<String> getFirstDimRange()
+ /**
+ * Check if a given domain of Strings is a singleton set containing the
given value
+ * @param rangeSet Domain of Strings
+ * @param val Value of String
+ * @return rangeSet == {val}
+ */
+ private boolean isRangeSetSingletonWithVal(RangeSet<String> rangeSet, String
val)
{
- Range<String> range;
- if (firstDimStart == null && firstDimEnd == null) {
- range = Range.all();
- } else if (firstDimStart == null) {
- range = Range.atMost(firstDimEnd);
- } else if (firstDimEnd == null) {
- range = Range.atLeast(firstDimStart);
- } else {
- range = Range.closed(firstDimStart, firstDimEnd);
- }
- return range;
+ Range<String> singletonRange = Range.closed(val, val);
+ RangeSet<String> singletonRangeSet = TreeRangeSet.create();
+ singletonRangeSet.add(singletonRange);
Review comment:
This would be cleaner but I think RangeSet.add() returns void. So this
wouldn't work. @AmatyaAvadhanula is working on simplifying this method.
--
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]