Search in sources :

Example 1 with LookupSegment

use of org.apache.druid.query.lookup.LookupSegment in project druid by druid-io.

the class LookupSegmentWrangler method getSegmentsForIntervals.

@Override
public Iterable<Segment> getSegmentsForIntervals(final DataSource dataSource, final Iterable<Interval> intervals) {
    final LookupDataSource lookupDataSource = (LookupDataSource) dataSource;
    final Optional<LookupExtractorFactoryContainer> maybeContainer = lookupProvider.get(lookupDataSource.getLookupName());
    return maybeContainer.map(container -> Collections.<Segment>singletonList(new LookupSegment(lookupDataSource.getLookupName(), container.getLookupExtractorFactory()))).orElse(Collections.emptyList());
}
Also used : Interval(org.joda.time.Interval) LookupDataSource(org.apache.druid.query.LookupDataSource) Inject(com.google.inject.Inject) DataSource(org.apache.druid.query.DataSource) LookupExtractorFactoryContainerProvider(org.apache.druid.query.lookup.LookupExtractorFactoryContainerProvider) Optional(java.util.Optional) JoinableFactory(org.apache.druid.segment.join.JoinableFactory) Collections(java.util.Collections) LookupSegment(org.apache.druid.query.lookup.LookupSegment) LookupExtractorFactoryContainer(org.apache.druid.query.lookup.LookupExtractorFactoryContainer) LookupDataSource(org.apache.druid.query.LookupDataSource) LookupSegment(org.apache.druid.query.lookup.LookupSegment) LookupExtractorFactoryContainer(org.apache.druid.query.lookup.LookupExtractorFactoryContainer) LookupSegment(org.apache.druid.query.lookup.LookupSegment)

Aggregations

Inject (com.google.inject.Inject)1 Collections (java.util.Collections)1 Optional (java.util.Optional)1 DataSource (org.apache.druid.query.DataSource)1 LookupDataSource (org.apache.druid.query.LookupDataSource)1 LookupExtractorFactoryContainer (org.apache.druid.query.lookup.LookupExtractorFactoryContainer)1 LookupExtractorFactoryContainerProvider (org.apache.druid.query.lookup.LookupExtractorFactoryContainerProvider)1 LookupSegment (org.apache.druid.query.lookup.LookupSegment)1 JoinableFactory (org.apache.druid.segment.join.JoinableFactory)1 Interval (org.joda.time.Interval)1