Search in sources :

Example 36 with BoundDimFilter

use of io.druid.query.filter.BoundDimFilter in project druid by druid-io.

the class BoundFilterTest method testNumericMatchNull.

@Test
public void testNumericMatchNull() {
    assertFilterMatches(new BoundDimFilter("dim0", "", "", false, false, false, null, StringComparators.NUMERIC), ImmutableList.<String>of());
    assertFilterMatches(new BoundDimFilter("dim1", "", "", false, false, false, null, StringComparators.NUMERIC), ImmutableList.of("0"));
    assertFilterMatches(new BoundDimFilter("dim2", "", "", false, false, false, null, StringComparators.NUMERIC), ImmutableList.of("1", "2", "5"));
    assertFilterMatches(new BoundDimFilter("dim3", "", "", false, false, false, null, StringComparators.NUMERIC), ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7"));
}
Also used : BoundDimFilter(io.druid.query.filter.BoundDimFilter) Test(org.junit.Test)

Example 37 with BoundDimFilter

use of io.druid.query.filter.BoundDimFilter in project druid by druid-io.

the class BoundFilterTest method testAlphaNumericMatchNull.

@Test
public void testAlphaNumericMatchNull() {
    assertFilterMatches(new BoundDimFilter("dim0", "", "", false, false, true, null, StringComparators.ALPHANUMERIC), ImmutableList.<String>of());
    assertFilterMatches(new BoundDimFilter("dim1", "", "", false, false, true, null, StringComparators.ALPHANUMERIC), ImmutableList.of("0"));
    assertFilterMatches(new BoundDimFilter("dim2", "", "", false, false, true, null, StringComparators.ALPHANUMERIC), ImmutableList.of("1", "2", "5"));
    assertFilterMatches(new BoundDimFilter("dim3", "", "", false, false, true, null, StringComparators.ALPHANUMERIC), ImmutableList.of("0", "1", "2", "3", "4", "5", "6", "7"));
}
Also used : BoundDimFilter(io.druid.query.filter.BoundDimFilter) Test(org.junit.Test)

Example 38 with BoundDimFilter

use of io.druid.query.filter.BoundDimFilter in project druid by druid-io.

the class BoundFilterTest method testAlphaNumericMatchNoUpperLimit.

@Test
public void testAlphaNumericMatchNoUpperLimit() {
    assertFilterMatches(new BoundDimFilter("dim1", "1", null, true, true, true, null, StringComparators.ALPHANUMERIC), ImmutableList.of("1", "2", "4", "5", "6", "7"));
    assertFilterMatches(new BoundDimFilter("dim1", "-1", null, true, true, true, null, StringComparators.ALPHANUMERIC), ImmutableList.of("4", "5", "6", "7"));
}
Also used : BoundDimFilter(io.druid.query.filter.BoundDimFilter) Test(org.junit.Test)

Example 39 with BoundDimFilter

use of io.druid.query.filter.BoundDimFilter in project druid by druid-io.

the class BoundFilterTest method testNumericMatchExactlySingleValue.

@Test
public void testNumericMatchExactlySingleValue() {
    assertFilterMatches(new BoundDimFilter("dim1", "2", "2", false, false, false, null, StringComparators.NUMERIC), ImmutableList.of("2"));
    assertFilterMatches(new BoundDimFilter("dim1", "-10.012", "-10.012", false, false, false, null, StringComparators.NUMERIC), ImmutableList.of("7"));
}
Also used : BoundDimFilter(io.druid.query.filter.BoundDimFilter) Test(org.junit.Test)

Example 40 with BoundDimFilter

use of io.druid.query.filter.BoundDimFilter in project druid by druid-io.

the class BoundFilterTest method testNumericMatchTooStrict.

@Test
public void testNumericMatchTooStrict() {
    assertFilterMatches(new BoundDimFilter("dim1", "2", "2", true, false, false, null, StringComparators.NUMERIC), ImmutableList.<String>of());
    assertFilterMatches(new BoundDimFilter("dim1", "2", "2", true, true, false, null, StringComparators.NUMERIC), ImmutableList.<String>of());
    assertFilterMatches(new BoundDimFilter("dim1", "2", "2", false, true, false, null, StringComparators.NUMERIC), ImmutableList.<String>of());
}
Also used : BoundDimFilter(io.druid.query.filter.BoundDimFilter) Test(org.junit.Test)

Aggregations

BoundDimFilter (io.druid.query.filter.BoundDimFilter)48 Test (org.junit.Test)38 SelectorDimFilter (io.druid.query.filter.SelectorDimFilter)23 InDimFilter (io.druid.query.filter.InDimFilter)17 JavaScriptDimFilter (io.druid.query.filter.JavaScriptDimFilter)12 RegexDimFilter (io.druid.query.filter.RegexDimFilter)12 SearchQueryDimFilter (io.druid.query.filter.SearchQueryDimFilter)12 ContainsSearchQuerySpec (io.druid.query.search.search.ContainsSearchQuerySpec)12 ArrayList (java.util.ArrayList)12 AndDimFilter (io.druid.query.filter.AndDimFilter)11 DimFilter (io.druid.query.filter.DimFilter)10 OrDimFilter (io.druid.query.filter.OrDimFilter)9 LongSumAggregatorFactory (io.druid.query.aggregation.LongSumAggregatorFactory)8 DefaultDimensionSpec (io.druid.query.dimension.DefaultDimensionSpec)6 LookupExtractionFn (io.druid.query.lookup.LookupExtractionFn)6 List (java.util.List)6 Row (io.druid.data.input.Row)5 Interval (org.joda.time.Interval)5 CountAggregatorFactory (io.druid.query.aggregation.CountAggregatorFactory)4 DoubleSumAggregatorFactory (io.druid.query.aggregation.DoubleSumAggregatorFactory)4