use of org.apache.druid.query.filter.ValueMatcher in project druid by druid-io.
the class PredicateValueMatcherFactoryTest method testDimensionProcessorMultiValuedDimensionNotMatchingValue.
@Test
public void testDimensionProcessorMultiValuedDimensionNotMatchingValue() {
// Emulate multi-valued dimension
final DictionaryEncodedColumnSupplier columnSupplier = new DictionaryEncodedColumnSupplier(GenericIndexed.fromIterable(ImmutableList.of("v1", "v2", "v3"), GenericIndexed.STRING_STRATEGY), GenericIndexed.fromIterable(ImmutableList.of(ByteBuffer.wrap(StringUtils.toUtf8("v1")), ByteBuffer.wrap(StringUtils.toUtf8("v2")), ByteBuffer.wrap(StringUtils.toUtf8("v3"))), GenericIndexed.BYTE_BUFFER_STRATEGY), null, () -> VSizeColumnarMultiInts.fromIterable(ImmutableList.of(VSizeColumnarInts.fromArray(new int[] { 1 }))), 0);
final ValueMatcher matcher = forSelector("v3").makeDimensionProcessor(columnSupplier.get().makeDimensionSelector(new SimpleAscendingOffset(1), null), true);
Assert.assertFalse(matcher.matches());
}
use of org.apache.druid.query.filter.ValueMatcher in project druid by druid-io.
the class PredicateValueMatcherFactoryTest method testLongProcessorMatchingValue.
@Test
public void testLongProcessorMatchingValue() {
final TestColumnValueSelector<Long> columnValueSelector = TestColumnValueSelector.of(Long.class, ImmutableList.of(2L), DateTimes.nowUtc());
columnValueSelector.advance();
final ValueMatcher matcher = forSelector("2").makeLongProcessor(columnValueSelector);
Assert.assertTrue(matcher.matches());
}
use of org.apache.druid.query.filter.ValueMatcher in project druid by druid-io.
the class PredicateValueMatcherFactoryTest method testComplexProcessorNotMatchingStringList.
@Test
public void testComplexProcessorNotMatchingStringList() {
final TestColumnValueSelector<String> columnValueSelector = TestColumnValueSelector.of(String.class, ImmutableList.of(ImmutableList.of("bar")), DateTimes.nowUtc());
columnValueSelector.advance();
final ValueMatcher matcher = forSelector("val").makeComplexProcessor(columnValueSelector);
Assert.assertFalse(matcher.matches());
}
use of org.apache.druid.query.filter.ValueMatcher in project druid by druid-io.
the class PredicateValueMatcherFactoryTest method testDimensionProcessorSingleValuedDimensionMatchingValue.
@Test
public void testDimensionProcessorSingleValuedDimensionMatchingValue() {
final ValueMatcher matcher = forSelector("0").makeDimensionProcessor(DimensionSelector.constant("0"), false);
Assert.assertTrue(matcher.matches());
}
use of org.apache.druid.query.filter.ValueMatcher in project druid by druid-io.
the class PredicateValueMatcherFactoryTest method testComplexProcessorMatchingEmptyList.
@Test
public void testComplexProcessorMatchingEmptyList() {
final TestColumnValueSelector<String> columnValueSelector = TestColumnValueSelector.of(String.class, ImmutableList.of(ImmutableList.of()), DateTimes.nowUtc());
columnValueSelector.advance();
final ValueMatcher matcher = forSelector(null).makeComplexProcessor(columnValueSelector);
Assert.assertTrue(matcher.matches());
}
Aggregations