use of org.apache.druid.query.filter.ValueMatcher in project druid by druid-io.
the class PredicateValueMatcherFactoryTest method testDoubleProcessorNotMatchingValue.
@Test
public void testDoubleProcessorNotMatchingValue() {
final TestColumnValueSelector<Double> columnValueSelector = TestColumnValueSelector.of(Double.class, ImmutableList.of(2.), DateTimes.nowUtc());
columnValueSelector.advance();
final ValueMatcher matcher = forSelector("5.").makeDoubleProcessor(columnValueSelector);
Assert.assertFalse(matcher.matches());
}
use of org.apache.druid.query.filter.ValueMatcher in project druid by druid-io.
the class PredicateValueMatcherFactoryTest method testComplexProcessorMatchingBoolean.
@Test
public void testComplexProcessorMatchingBoolean() {
final TestColumnValueSelector<String> columnValueSelector = TestColumnValueSelector.of(String.class, ImmutableList.of(false), DateTimes.nowUtc());
columnValueSelector.advance();
final ValueMatcher matcher = forSelector("false").makeComplexProcessor(columnValueSelector);
Assert.assertTrue(matcher.matches());
}
use of org.apache.druid.query.filter.ValueMatcher in project druid by druid-io.
the class PredicateValueMatcherFactoryTest method testComplexProcessorEmptyString.
@Test
public void testComplexProcessorEmptyString() {
final TestColumnValueSelector<String> columnValueSelector = TestColumnValueSelector.of(String.class, Arrays.asList("", "v"), DateTimes.nowUtc());
columnValueSelector.advance();
final ValueMatcher matcher = forSelector(null).makeComplexProcessor(columnValueSelector);
if (NullHandling.sqlCompatible()) {
Assert.assertFalse(matcher.matches());
} else {
Assert.assertTrue(matcher.matches());
}
}
use of org.apache.druid.query.filter.ValueMatcher in project druid by druid-io.
the class PredicateValueMatcherFactoryTest method testComplexProcessorMatchingLong.
@Test
public void testComplexProcessorMatchingLong() {
final TestColumnValueSelector<Long> columnValueSelector = TestColumnValueSelector.of(Long.class, ImmutableList.of(11L), DateTimes.nowUtc());
columnValueSelector.advance();
final ValueMatcher matcher = forSelector("11").makeComplexProcessor(columnValueSelector);
Assert.assertTrue(matcher.matches());
}
use of org.apache.druid.query.filter.ValueMatcher in project druid by druid-io.
the class PredicateValueMatcherFactoryTest method testDoubleProcessorMatchingValue.
@Test
public void testDoubleProcessorMatchingValue() {
final TestColumnValueSelector<Double> columnValueSelector = TestColumnValueSelector.of(Double.class, ImmutableList.of(2.), DateTimes.nowUtc());
columnValueSelector.advance();
final ValueMatcher matcher = forSelector("2.").makeDoubleProcessor(columnValueSelector);
Assert.assertTrue(matcher.matches());
}
Aggregations