use of io.druid.query.filter.SelectorDimFilter in project druid by druid-io.
the class NotFilterTest method testNotSelector.
@Test
public void testNotSelector() {
assertFilterMatches(new NotDimFilter(new SelectorDimFilter("dim0", null, null)), ImmutableList.of("0", "1", "2", "3", "4", "5"));
assertFilterMatches(new NotDimFilter(new SelectorDimFilter("dim0", "", null)), ImmutableList.of("0", "1", "2", "3", "4", "5"));
assertFilterMatches(new NotDimFilter(new SelectorDimFilter("dim0", "0", null)), ImmutableList.of("1", "2", "3", "4", "5"));
assertFilterMatches(new NotDimFilter(new SelectorDimFilter("dim0", "1", null)), ImmutableList.of("0", "2", "3", "4", "5"));
}
use of io.druid.query.filter.SelectorDimFilter in project druid by druid-io.
the class SelectorFilterTest method testMissingColumnNotSpecifiedInDimensionList.
@Test
public void testMissingColumnNotSpecifiedInDimensionList() {
assertFilterMatches(new SelectorDimFilter("dim4", null, null), ImmutableList.of("0", "1", "2", "3", "4", "5"));
assertFilterMatches(new SelectorDimFilter("dim4", "", null), ImmutableList.of("0", "1", "2", "3", "4", "5"));
assertFilterMatches(new SelectorDimFilter("dim4", "a", null), ImmutableList.<String>of());
assertFilterMatches(new SelectorDimFilter("dim4", "b", null), ImmutableList.<String>of());
assertFilterMatches(new SelectorDimFilter("dim4", "c", null), ImmutableList.<String>of());
}
use of io.druid.query.filter.SelectorDimFilter in project druid by druid-io.
the class SelectorFilterTest method testSingleValueStringColumnWithoutNulls.
@Test
public void testSingleValueStringColumnWithoutNulls() {
assertFilterMatches(new SelectorDimFilter("dim0", null, null), ImmutableList.<String>of());
assertFilterMatches(new SelectorDimFilter("dim0", "", null), ImmutableList.<String>of());
assertFilterMatches(new SelectorDimFilter("dim0", "0", null), ImmutableList.of("0"));
assertFilterMatches(new SelectorDimFilter("dim0", "1", null), ImmutableList.of("1"));
}
use of io.druid.query.filter.SelectorDimFilter in project druid by druid-io.
the class SelectorFilterTest method testExpressionVirtualColumn.
@Test
public void testExpressionVirtualColumn() {
assertFilterMatches(new SelectorDimFilter("expr", "1.1", null), ImmutableList.of("0", "1", "2", "3", "4", "5"));
assertFilterMatches(new SelectorDimFilter("expr", "1.2", null), ImmutableList.<String>of());
}
use of io.druid.query.filter.SelectorDimFilter in project druid by druid-io.
the class SelectorFilterTest method testSingleValueStringColumnWithNulls.
@Test
public void testSingleValueStringColumnWithNulls() {
assertFilterMatches(new SelectorDimFilter("dim1", null, null), ImmutableList.of("0"));
assertFilterMatches(new SelectorDimFilter("dim1", "", null), ImmutableList.of("0"));
assertFilterMatches(new SelectorDimFilter("dim1", "10", null), ImmutableList.of("1"));
assertFilterMatches(new SelectorDimFilter("dim1", "2", null), ImmutableList.of("2"));
assertFilterMatches(new SelectorDimFilter("dim1", "1", null), ImmutableList.of("3"));
assertFilterMatches(new SelectorDimFilter("dim1", "def", null), ImmutableList.of("4"));
assertFilterMatches(new SelectorDimFilter("dim1", "abc", null), ImmutableList.of("5"));
assertFilterMatches(new SelectorDimFilter("dim1", "ab", null), ImmutableList.<String>of());
}
Aggregations