Search in sources :

Example 1 with LookupJoinableFactory

use of org.apache.druid.segment.join.LookupJoinableFactory in project druid by druid-io.

the class QueryStackTests method makeJoinableFactoryFromDefault.

public static JoinableFactory makeJoinableFactoryFromDefault(@Nullable LookupExtractorFactoryContainerProvider lookupProvider, @Nullable Set<JoinableFactory> customFactories, @Nullable Map<Class<? extends JoinableFactory>, Class<? extends DataSource>> customMappings) {
    ImmutableSet.Builder<JoinableFactory> setBuilder = ImmutableSet.builder();
    ImmutableMap.Builder<Class<? extends JoinableFactory>, Class<? extends DataSource>> mapBuilder = ImmutableMap.builder();
    setBuilder.add(new InlineJoinableFactory());
    mapBuilder.put(InlineJoinableFactory.class, InlineDataSource.class);
    if (lookupProvider != null) {
        setBuilder.add(new LookupJoinableFactory(lookupProvider));
        mapBuilder.put(LookupJoinableFactory.class, LookupDataSource.class);
    }
    if (customFactories != null) {
        setBuilder.addAll(customFactories);
    }
    if (customMappings != null) {
        mapBuilder.putAll(customMappings);
    }
    return new MapJoinableFactory(setBuilder.build(), mapBuilder.build());
}
Also used : ImmutableSet(com.google.common.collect.ImmutableSet) LookupJoinableFactory(org.apache.druid.segment.join.LookupJoinableFactory) InlineJoinableFactory(org.apache.druid.segment.join.InlineJoinableFactory) MapJoinableFactory(org.apache.druid.segment.join.MapJoinableFactory) MapJoinableFactory(org.apache.druid.segment.join.MapJoinableFactory) InlineJoinableFactory(org.apache.druid.segment.join.InlineJoinableFactory) LookupJoinableFactory(org.apache.druid.segment.join.LookupJoinableFactory) JoinableFactory(org.apache.druid.segment.join.JoinableFactory) ImmutableMap(com.google.common.collect.ImmutableMap) DataSource(org.apache.druid.query.DataSource) LookupDataSource(org.apache.druid.query.LookupDataSource) InlineDataSource(org.apache.druid.query.InlineDataSource)

Aggregations

ImmutableMap (com.google.common.collect.ImmutableMap)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 DataSource (org.apache.druid.query.DataSource)1 InlineDataSource (org.apache.druid.query.InlineDataSource)1 LookupDataSource (org.apache.druid.query.LookupDataSource)1 InlineJoinableFactory (org.apache.druid.segment.join.InlineJoinableFactory)1 JoinableFactory (org.apache.druid.segment.join.JoinableFactory)1 LookupJoinableFactory (org.apache.druid.segment.join.LookupJoinableFactory)1 MapJoinableFactory (org.apache.druid.segment.join.MapJoinableFactory)1