Search in sources :

Example 6 with BoundDimFilter

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

the class BoundFilterTest method testNumericMatchVirtualColumn.

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

Example 7 with BoundDimFilter

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

the class BoundFilterTest method testLexicographicMatchNull.

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

Example 8 with BoundDimFilter

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

the class BoundFilterTest method testLexicographicMatchMissingColumn.

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

Example 9 with BoundDimFilter

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

the class BoundFilterTest method testAlphaNumericMatchTooStrict.

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

Example 10 with BoundDimFilter

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

the class BoundFilterTest method testAlphaNumericMatchWithNegatives.

@Test
public void testAlphaNumericMatchWithNegatives() {
    assertFilterMatches(new BoundDimFilter("dim1", "-2000", "3", true, true, true, null, StringComparators.ALPHANUMERIC), ImmutableList.<String>of());
    assertFilterMatches(new BoundDimFilter("dim1", "3", "-2000", true, true, true, null, StringComparators.ALPHANUMERIC), ImmutableList.of("1", "6", "7"));
}
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