Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public class TimeseriesBenchmark
@Param({"750000"})
private int rowsPerSegment;

@Param({"basic.A", "basic.timeFilter", "basic.timeFilterAlphanumeric", "basic.timeFilterByInterval"})
@Param({"basic.A", "basic.timeFilterNumeric", "basic.timeFilterAlphanumeric", "basic.timeFilterByInterval"})
private String schemaAndQuery;

private static final Logger log = new Logger(TimeseriesBenchmark.class);
Expand Down Expand Up @@ -190,7 +190,7 @@ private void setupQueries()
.descending(false)
.build();

basicQueries.put("timeFilter", timeFilterQuery);
basicQueries.put("timeFilterNumeric", timeFilterQuery);
}
{
QuerySegmentSpec intervalSpec = new MultipleIntervalSegmentSpec(Arrays.asList(basicSchema.getDataInterval()));
Expand Down
20 changes: 10 additions & 10 deletions processing/src/main/java/io/druid/segment/filter/BoundFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
package io.druid.segment.filter;

import com.google.common.base.Predicate;
import com.google.common.base.Strings;
import com.google.common.base.Supplier;
import com.google.common.primitives.Longs;
import com.metamx.collections.bitmap.ImmutableBitmap;
import io.druid.query.extraction.ExtractionFn;
import io.druid.query.filter.BitmapIndexSelector;
Expand Down Expand Up @@ -57,13 +55,9 @@ public BoundFilter(final BoundDimFilter boundDimFilter)
@Override
public ImmutableBitmap getBitmapIndex(final BitmapIndexSelector selector)
{
if (!boundDimFilter.getOrdering().equals(StringComparators.LEXICOGRAPHIC_NAME) || extractionFn != null) {
return Filters.matchPredicate(
boundDimFilter.getDimension(),
selector,
getPredicateFactory().makeStringPredicate()
);
} else {
if (boundDimFilter.getOrdering().equals(StringComparators.LEXICOGRAPHIC) && extractionFn == null) {
// Optimization for lexicographic bounds with no extractionFn => binary search through the index

final BitmapIndex bitmapIndex = selector.getBitmapIndex(boundDimFilter.getDimension());

if (bitmapIndex == null || bitmapIndex.getCardinality() == 0) {
Expand Down Expand Up @@ -133,6 +127,12 @@ public void remove()
}
}
);
} else {
return Filters.matchPredicate(
boundDimFilter.getDimension(),
selector,
getPredicateFactory().makeStringPredicate()
);
}
}

Expand Down Expand Up @@ -188,7 +188,7 @@ public boolean applyLong(long input)
return doesMatch(extractionFn.apply(input));
}
};
} else if (boundDimFilter.getOrdering().equals(StringComparators.NUMERIC_NAME)){
} else if (boundDimFilter.getOrdering().equals(StringComparators.NUMERIC)) {
return longPredicateSupplier.get();
} else {
return new DruidLongPredicate()
Expand Down