AmatyaAvadhanula commented on a change in pull request #12046:
URL: https://github.com/apache/druid/pull/12046#discussion_r766360320
##########
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);
+ return rangeSet.equals(singletonRangeSet);
}
@Override
public boolean possibleInDomain(Map<String, RangeSet<String>> domain)
{
- RangeSet<String> rangeSet = domain.get(dimensions.get(0));
- if (rangeSet == null) {
- return true;
+ // Indicate if start[0:dim), end[0:dim) are the greatest, least members of
domain[0:dim) respectively
+ boolean startIsGreatestInDomain = true, endIsLeastInDomain = true;
+ for (int dim = 0; dim < dimensions.size(); dim++) {
Review comment:
done
--
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]