Package io.druid.query

Examples of io.druid.query.Result


                        final String segmentId,
                        final Interval interval,
                        final Iterable<Result<TimeseriesResultValue>> results
                    )
                    {
                      return new Result(
                          results.iterator().next().getTimestamp(),
                          new BySegmentResultValueClass(
                              Lists.newArrayList(results),
                              segmentId,
                              interval
View Full Code Here


                      final String segmentId,
                      final Interval interval,
                      final Iterable<Result<TopNResultValue>> results
                  )
                  {
                    return new Result(
                        interval.getStart(),
                        new BySegmentResultValueClass(
                            Lists.newArrayList(results),
                            segmentId,
                            interval
View Full Code Here

                      final String segmentId,
                      final Interval interval,
                      final Iterable<Result<SearchResultValue>> results
                  )
                  {
                    return new Result(
                        results.iterator().next().getTimestamp(),
                        new BySegmentResultValueClass(
                            Lists.newArrayList(results),
                            segmentId,
                            interval
View Full Code Here

                      final String segmentId,
                      final Interval interval,
                      final Iterable<Result<SelectResultValue>> results
                  )
                  {
                    return new Result(
                        results.iterator().next().getTimestamp(),
                        new BySegmentResultValueClass(
                            Lists.newArrayList(results),
                            segmentId,
                            interval
View Full Code Here

                      final String segmentId,
                      final Interval interval,
                      final Iterable<Row> results
                  )
                  {
                    return new Result(
                        results.iterator().next().getTimestamp(),
                        new BySegmentResultValueClass(
                            Lists.newArrayList(results),
                            segmentId,
                            interval
View Full Code Here

                      final String segmentId,
                      final Interval interval,
                      final Iterable<Result<TimeBoundaryResultValue>> results
                  )
                  {
                    return new Result(
                        results.iterator().next().getTimestamp(),
                        new BySegmentResultValueClass(
                            Lists.newArrayList(results),
                            segmentId,
                            interval
View Full Code Here

        runner.run(query, CONTEXT),
        Lists.<Result<TimeseriesResultValue>>newArrayList()
    );

    int count = 0;
    Result lastResult = null;
    for (Result<TimeseriesResultValue> result : results) {
      lastResult = result;
      Assert.assertEquals(expectedEarliest, result.getTimestamp());
      Assert.assertFalse(
          String.format("Timestamp[%s] > expectedLast[%s]", result.getTimestamp(), expectedLast),
          result.getTimestamp().isAfter(expectedLast)
      );

      final TimeseriesResultValue value = result.getValue();

      Assert.assertEquals(
          result.toString(),
          QueryRunnerTestHelper.skippedDay.equals(result.getTimestamp()) ? 0L : 13L,
          value.getLongMetric("rows").longValue()
      );
      Assert.assertEquals(
          result.toString(),
          QueryRunnerTestHelper.expectedFullOnIndexValues[count],
          String.valueOf(value.getDoubleMetric("index"))
      );
      Assert.assertEquals(
          result.toString(),
          new Double(QueryRunnerTestHelper.expectedFullOnIndexValues[count]) +
          (QueryRunnerTestHelper.skippedDay.equals(result.getTimestamp()) ? 0L : 13L) + 1L,
          value.getDoubleMetric("addRowsIndexConstant"),
          0.0
      );
      Assert.assertEquals(
          value.getDoubleMetric("uniques"),
          QueryRunnerTestHelper.skippedDay.equals(result.getTimestamp()) ? 0.0d : 9.0d,
          0.02
      );

      expectedEarliest = gran.toDateTime(gran.next(expectedEarliest.getMillis()));
      ++count;
    }

    Assert.assertEquals(lastResult.toString(), expectedLast, lastResult.getTimestamp());
  }
View Full Code Here

    Iterator<Result<Object>> it1 = expectedResults.iterator();
    Iterator<Result<Object>> it2 = resultsAfter.iterator();

    while (it1.hasNext() && it2.hasNext()) {
      Result r1 = it1.next();
      Result r2 = it2.next();

      Assert.assertEquals(r1.getTimestamp(), r2.getTimestamp());
      Assert.assertEquals(r1.getValue(), r2.getValue());
    }
  }
View Full Code Here

TOP

Related Classes of io.druid.query.Result

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.