Package io.druid.query.metadata.metadata

Examples of io.druid.query.metadata.metadata.SegmentMetadataQuery


    return new QueryRunner<SegmentAnalysis>()
    {
      @Override
      public Sequence<SegmentAnalysis> run(Query<SegmentAnalysis> inQ, Map<String, Object> context)
      {
        SegmentMetadataQuery query = (SegmentMetadataQuery) inQ;

        final QueryableIndex index = segment.asQueryableIndex();
        if (index == null) {
          return Sequences.empty();
        }

        final Map<String, ColumnAnalysis> analyzedColumns = analyzer.analyze(index);

        // Initialize with the size of the whitespace, 1 byte per
        long totalSize = analyzedColumns.size() * index.getNumRows();

        Map<String, ColumnAnalysis> columns = Maps.newTreeMap();
        ColumnIncluderator includerator = query.getToInclude();
        for (Map.Entry<String, ColumnAnalysis> entry : analyzedColumns.entrySet()) {
          final String columnName = entry.getKey();
          final ColumnAnalysis column = entry.getValue();

          if (!column.isError()) {
View Full Code Here


  @Test
  @SuppressWarnings("unchecked")
  public void testSegmentMetadataQuery()
  {
    SegmentMetadataQuery query = Druids.newSegmentMetadataQueryBuilder()
                                       .dataSource("testing")
                                       .intervals("2013/2014")
                                       .toInclude(new ListColumnIncluderator(Arrays.asList("placement")))
                                       .merge(true)
                                       .build();
View Full Code Here

            new SegmentMetadataQueryQueryToolChest(),
            QueryRunnerTestHelper.NOOP_QUERYWATCHER
        ), index
    );

    final SegmentMetadataQuery query = new SegmentMetadataQuery(
        new LegacyDataSource("test"), QuerySegmentSpecs.create("2011/2012"), null, null, null
    );
    HashMap<String,Object> context = new HashMap<String, Object>();
    return Sequences.toList(query.run(runner, context), Lists.<SegmentAnalysis>newArrayList());
  }
View Full Code Here

      context = null;
    }

    public SegmentMetadataQuery build()
    {
      return new SegmentMetadataQuery(
          dataSource,
          querySegmentSpec,
          toInclude,
          merge,
          context
View Full Code Here

TOP

Related Classes of io.druid.query.metadata.metadata.SegmentMetadataQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.