use of org.apache.druid.query.filter.ValueMatcher in project druid by druid-io.
the class PredicateValueMatcherFactoryTest method testComplexProcessorNotMatchingDouble.
@Test
public void testComplexProcessorNotMatchingDouble() {
final TestColumnValueSelector<Double> columnValueSelector = TestColumnValueSelector.of(Double.class, ImmutableList.of(15.d), DateTimes.nowUtc());
columnValueSelector.advance();
final ValueMatcher matcher = forSelector("11.d").makeComplexProcessor(columnValueSelector);
Assert.assertFalse(matcher.matches());
}
use of org.apache.druid.query.filter.ValueMatcher in project druid by druid-io.
the class PredicateValueMatcherFactoryTest method testComplexProcessorMatchingByteArray.
@Test
public void testComplexProcessorMatchingByteArray() {
final TestColumnValueSelector<String> columnValueSelector = TestColumnValueSelector.of(String.class, ImmutableList.of(StringUtils.toUtf8("var")), DateTimes.nowUtc());
columnValueSelector.advance();
final String base64Encoded = StringUtils.encodeBase64String(StringUtils.toUtf8("var"));
final ValueMatcher matcher = forSelector(base64Encoded).makeComplexProcessor(columnValueSelector);
Assert.assertTrue(matcher.matches());
}
use of org.apache.druid.query.filter.ValueMatcher in project druid by druid-io.
the class PredicateValueMatcherFactoryTest method testDimensionProcessorSingleValuedDimensionNotMatchingValue.
@Test
public void testDimensionProcessorSingleValuedDimensionNotMatchingValue() {
final ValueMatcher matcher = forSelector("1").makeDimensionProcessor(DimensionSelector.constant("0"), false);
Assert.assertFalse(matcher.matches());
}
use of org.apache.druid.query.filter.ValueMatcher in project druid by druid-io.
the class PredicateValueMatcherFactoryTest method testComplexProcessorMatchingString.
@Test
public void testComplexProcessorMatchingString() {
final TestColumnValueSelector<String> columnValueSelector = TestColumnValueSelector.of(String.class, ImmutableList.of("val"), DateTimes.nowUtc());
columnValueSelector.advance();
final ValueMatcher matcher = forSelector("val").makeComplexProcessor(columnValueSelector);
Assert.assertTrue(matcher.matches());
}
use of org.apache.druid.query.filter.ValueMatcher in project druid by druid-io.
the class PredicateValueMatcherFactoryTest method testComplexProcessorMatchingNull.
@Test
public void testComplexProcessorMatchingNull() {
final TestColumnValueSelector<String> columnValueSelector = TestColumnValueSelector.of(String.class, Arrays.asList(null, "v"), DateTimes.nowUtc());
columnValueSelector.advance();
final ValueMatcher matcher = forSelector(null).makeComplexProcessor(columnValueSelector);
Assert.assertTrue(matcher.matches());
}
Aggregations