use of org.apache.druid.segment.join.filter.JoinFilterPreAnalysis in project druid by druid-io.
the class HashJoinSegmentStorageAdapterTest method test_makeCursors_factToCountryRightWithFilterOnJoinable.
@Test
public void test_makeCursors_factToCountryRightWithFilterOnJoinable() {
List<JoinableClause> joinableClauses = ImmutableList.of(factToCountryOnIsoCode(JoinType.RIGHT));
Filter filter = new SelectorDimFilter(FACT_TO_COUNTRY_ON_ISO_CODE_PREFIX + "countryName", "Germany", null).toFilter();
JoinFilterPreAnalysis joinFilterPreAnalysis = makeDefaultConfigPreAnalysis(filter, joinableClauses, VirtualColumns.EMPTY);
JoinTestHelper.verifyCursors(new HashJoinSegmentStorageAdapter(factSegment.asStorageAdapter(), joinableClauses, joinFilterPreAnalysis).makeCursors(filter, Intervals.ETERNITY, VirtualColumns.EMPTY, Granularities.ALL, false, null), ImmutableList.of("page", "countryIsoCode", "countryNumber", FACT_TO_COUNTRY_ON_ISO_CODE_PREFIX + "countryIsoCode", FACT_TO_COUNTRY_ON_ISO_CODE_PREFIX + "countryName", FACT_TO_COUNTRY_ON_ISO_CODE_PREFIX + "countryNumber"), ImmutableList.of(new Object[] { "Diskussion:Sebastian Schulz", "DE", 3L, "DE", "Germany", 3L }));
}
use of org.apache.druid.segment.join.filter.JoinFilterPreAnalysis in project druid by druid-io.
the class HashJoinSegmentStorageAdapterTest method test_makeCursors_factToRegionToCountryLeft.
@Test
public void test_makeCursors_factToRegionToCountryLeft() {
List<JoinableClause> joinableClauses = ImmutableList.of(factToRegion(JoinType.LEFT), regionToCountry(JoinType.LEFT));
JoinFilterPreAnalysis joinFilterPreAnalysis = makeDefaultConfigPreAnalysis(null, joinableClauses, VirtualColumns.EMPTY);
JoinTestHelper.verifyCursors(new HashJoinSegmentStorageAdapter(factSegment.asStorageAdapter(), joinableClauses, joinFilterPreAnalysis).makeCursors(null, Intervals.ETERNITY, VirtualColumns.EMPTY, Granularities.ALL, false, null), ImmutableList.of("page", FACT_TO_REGION_PREFIX + "regionName", REGION_TO_COUNTRY_PREFIX + "countryName"), ImmutableList.of(new Object[] { "Talk:Oswald Tilghman", null, null }, new Object[] { "Rallicula", null, null }, new Object[] { "Peremptory norm", "New South Wales", "Australia" }, new Object[] { "Apamea abruzzorum", null, null }, new Object[] { "Atractus flammigerus", null, null }, new Object[] { "Agama mossambica", null, null }, new Object[] { "Mathis Bolly", "Mexico City", "Mexico" }, new Object[] { "유희왕 GX", "Seoul", "Republic of Korea" }, new Object[] { "青野武", "Tōkyō", "Japan" }, new Object[] { "Golpe de Estado en Chile de 1973", "Santiago Metropolitan", "Chile" }, new Object[] { "President of India", "California", "United States" }, new Object[] { "Diskussion:Sebastian Schulz", "Hesse", "Germany" }, new Object[] { "Saison 9 de Secret Story", "Val d'Oise", "France" }, new Object[] { "Glasgow", "Kingston upon Hull", "United Kingdom" }, new Object[] { "Didier Leclair", "Ontario", "Canada" }, new Object[] { "Les Argonautes", "Quebec", "Canada" }, new Object[] { "Otjiwarongo Airport", "California", "United States" }, new Object[] { "Sarah Michelle Gellar", "Ontario", "Canada" }, new Object[] { "DirecTV", "North Carolina", "United States" }, new Object[] { "Carlo Curti", "California", "United States" }, new Object[] { "Giusy Ferreri discography", "Provincia di Varese", "Italy" }, new Object[] { "Roma-Bangkok", "Provincia di Varese", "Italy" }, new Object[] { "Wendigo", "Departamento de San Salvador", "El Salvador" }, new Object[] { "Алиса в Зазеркалье", "Finnmark Fylke", "Norway" }, new Object[] { "Gabinete Ministerial de Rafael Correa", "Provincia del Guayas", "Ecuador" }, new Object[] { "Old Anatolian Turkish", "Virginia", "United States" }, new Object[] { "Cream Soda", "Ainigriv", "States United" }, new Object[] { "Orange Soda", null, null }, new Object[] { "History of Fourems", "Fourems Province", "Fourems" }));
}
use of org.apache.druid.segment.join.filter.JoinFilterPreAnalysis in project druid by druid-io.
the class HashJoinSegmentStorageAdapterTest method test_makeCursors_factToCountryLeftWithBaseFilter.
@Test
public void test_makeCursors_factToCountryLeftWithBaseFilter() {
final Filter baseFilter = Filters.or(Arrays.asList(new SelectorDimFilter("countryIsoCode", "CA", null).toFilter(), new SelectorDimFilter("countryIsoCode", "MatchNothing", null).toFilter()));
List<JoinableClause> joinableClauses = ImmutableList.of(factToCountryOnIsoCode(JoinType.LEFT));
JoinFilterPreAnalysis joinFilterPreAnalysis = makeDefaultConfigPreAnalysis(baseFilter, joinableClauses, VirtualColumns.EMPTY);
JoinTestHelper.verifyCursors(new HashJoinSegmentStorageAdapter(factSegment.asStorageAdapter(), baseFilter, joinableClauses, joinFilterPreAnalysis).makeCursors(null, Intervals.ETERNITY, VirtualColumns.EMPTY, Granularities.ALL, false, null), ImmutableList.of("page", "countryIsoCode", FACT_TO_COUNTRY_ON_ISO_CODE_PREFIX + "countryIsoCode", FACT_TO_COUNTRY_ON_ISO_CODE_PREFIX + "countryName", FACT_TO_COUNTRY_ON_ISO_CODE_PREFIX + "countryNumber"), ImmutableList.of(new Object[] { "Didier Leclair", "CA", "CA", "Canada", 1L }, new Object[] { "Les Argonautes", "CA", "CA", "Canada", 1L }, new Object[] { "Sarah Michelle Gellar", "CA", "CA", "Canada", 1L }, new Object[] { "Orange Soda", "MatchNothing", null, null, NULL_COUNTRY }));
}
use of org.apache.druid.segment.join.filter.JoinFilterPreAnalysis in project druid by druid-io.
the class HashJoinSegmentStorageAdapterTest method test_makeCursors_factToCountryUsingExpressionUsingLookup.
@Test
public void test_makeCursors_factToCountryUsingExpressionUsingLookup() {
List<JoinableClause> joinableClauses = ImmutableList.of(new JoinableClause(FACT_TO_COUNTRY_ON_ISO_CODE_PREFIX, LookupJoinable.wrap(countryIsoCodeToNameLookup), JoinType.INNER, JoinConditionAnalysis.forExpression(StringUtils.format("\"%sk\" == concat(substring(countryIsoCode, 0, 1),'L')", FACT_TO_COUNTRY_ON_ISO_CODE_PREFIX), FACT_TO_COUNTRY_ON_ISO_CODE_PREFIX, ExprMacroTable.nil())));
JoinFilterPreAnalysis joinFilterPreAnalysis = makeDefaultConfigPreAnalysis(null, joinableClauses, VirtualColumns.EMPTY);
JoinTestHelper.verifyCursors(new HashJoinSegmentStorageAdapter(factSegment.asStorageAdapter(), joinableClauses, joinFilterPreAnalysis).makeCursors(null, Intervals.ETERNITY, VirtualColumns.EMPTY, Granularities.ALL, false, null), ImmutableList.of("page", "countryIsoCode", FACT_TO_COUNTRY_ON_ISO_CODE_PREFIX + "k", FACT_TO_COUNTRY_ON_ISO_CODE_PREFIX + "v"), ImmutableList.of(new Object[] { "Golpe de Estado en Chile de 1973", "CL", "CL", "Chile" }, new Object[] { "Didier Leclair", "CA", "CL", "Chile" }, new Object[] { "Les Argonautes", "CA", "CL", "Chile" }, new Object[] { "Sarah Michelle Gellar", "CA", "CL", "Chile" }));
}
use of org.apache.druid.segment.join.filter.JoinFilterPreAnalysis in project druid by druid-io.
the class HashJoinSegmentStorageAdapterTest method test_makeCursors_factToCountryRightWithFilterOnJoinableUsingLookup.
@Test
public void test_makeCursors_factToCountryRightWithFilterOnJoinableUsingLookup() {
List<JoinableClause> joinableClauses = ImmutableList.of(factToCountryNameUsingIsoCodeLookup(JoinType.RIGHT));
Filter filter = new SelectorDimFilter(FACT_TO_COUNTRY_ON_ISO_CODE_PREFIX + "v", "Germany", null).toFilter();
JoinFilterPreAnalysis joinFilterPreAnalysis = makeDefaultConfigPreAnalysis(filter, joinableClauses, VirtualColumns.EMPTY);
JoinTestHelper.verifyCursors(new HashJoinSegmentStorageAdapter(factSegment.asStorageAdapter(), joinableClauses, joinFilterPreAnalysis).makeCursors(filter, Intervals.ETERNITY, VirtualColumns.EMPTY, Granularities.ALL, false, null), ImmutableList.of("page", "countryIsoCode", "countryNumber", FACT_TO_COUNTRY_ON_ISO_CODE_PREFIX + "k", FACT_TO_COUNTRY_ON_ISO_CODE_PREFIX + "v"), ImmutableList.of(new Object[] { "Diskussion:Sebastian Schulz", "DE", 3L, "DE", "Germany" }));
}
Aggregations