Package io.druid.data.input.impl

Examples of io.druid.data.input.impl.DimensionsSpec


    //configure parser with desc file
    ProtoBufInputRowParser parser = new ProtoBufInputRowParser(
        new JSONParseSpec(
            new TimestampSpec("timestamp", "iso"),
            new DimensionsSpec(Arrays.asList(DIMENSIONS), Arrays.<String>asList(), null)
        ),
        "prototest.desc",
        null, null, null, null
    );
View Full Code Here


  {
    // Backwards Compatible
    if (parseSpec == null) {
      this.parseSpec = new JSONParseSpec(
          timestampSpec,
          new DimensionsSpec(dimensions, dimensionExclusions, spatialDimensions)
      );
    } else {
      this.parseSpec = parseSpec;
    }
View Full Code Here

          @Override
          public ParseSpec getParseSpec()
          {
            return new JSONParseSpec(
                new TimestampSpec("timestamp", "auto"),
                new DimensionsSpec(null, null, null)
            );
          }

          @Override
          public InputRowParser withParseSpec(ParseSpec parseSpec)
View Full Code Here

    final Set<String> dimensionExclusions = Sets.newHashSet();
    for (AggregatorFactory aggregator : aggregators) {
      dimensionExclusions.addAll(aggregator.requiredFields());
    }
    if (parser != null && parser.getParseSpec() != null) {
      final DimensionsSpec dimensionsSpec = parser.getParseSpec().getDimensionsSpec();
      final TimestampSpec timestampSpec = parser.getParseSpec().getTimestampSpec();

      // exclude timestamp from dimensions by default, unless explicitly included in the list of dimensions
      if (timestampSpec != null) {
        final String timestampColumn = timestampSpec.getTimestampColumn();
        if (!(dimensionsSpec.hasCustomDimensions() && dimensionsSpec.getDimensions().contains(timestampColumn))) {
          dimensionExclusions.add(timestampColumn);
        }
      }
      if (dimensionsSpec != null) {
        this.parser = parser.withParseSpec(
            parser.getParseSpec()
                  .withDimensionsSpec(
                      dimensionsSpec
                            .withDimensionExclusions(
                                Sets.difference(dimensionExclusions,
                                                Sets.newHashSet(dimensionsSpec.getDimensions()))
                            )
                  )
        );
      } else {
        this.parser = parser;
View Full Code Here

    public Builder()
    {
      this.minTimestamp = 0L;
      this.gran = QueryGranularity.NONE;
      this.dimensionsSpec = new DimensionsSpec(null, null, null);
      this.metrics = new AggregatorFactory[]{};
    }
View Full Code Here

      if (parser != null
          && parser.getParseSpec() != null
          && parser.getParseSpec().getDimensionsSpec() != null) {
        this.dimensionsSpec = parser.getParseSpec().getDimensionsSpec();
      } else {
        this.dimensionsSpec = new DimensionsSpec(null, null, null);
      }

      return this;
    }
View Full Code Here

TOP

Related Classes of io.druid.data.input.impl.DimensionsSpec

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.