mirror of https://github.com/apache/druid.git
Make TimeBoundaryQuery buildResult no longer static.
This commit is contained in:
parent
ef7e786b96
commit
3db07d2a55
|
@ -52,24 +52,6 @@ public class TimeBoundaryQuery extends BaseQuery<Result<TimeBoundaryResultValue>
|
|||
|
||||
private static final byte CACHE_TYPE_ID = 0x0;
|
||||
|
||||
public static Iterable<Result<TimeBoundaryResultValue>> buildResult(DateTime timestamp, DateTime min, DateTime max)
|
||||
{
|
||||
List<Result<TimeBoundaryResultValue>> results = Lists.newArrayList();
|
||||
Map<String, Object> result = Maps.newHashMap();
|
||||
|
||||
if (min != null) {
|
||||
result.put(MIN_TIME, min);
|
||||
}
|
||||
if (max != null) {
|
||||
result.put(MAX_TIME, max);
|
||||
}
|
||||
if (!result.isEmpty()) {
|
||||
results.add(new Result<>(timestamp, new TimeBoundaryResultValue(result)));
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
private final String bound;
|
||||
|
||||
@JsonCreator
|
||||
|
@ -150,6 +132,24 @@ public class TimeBoundaryQuery extends BaseQuery<Result<TimeBoundaryResultValue>
|
|||
.array();
|
||||
}
|
||||
|
||||
public Iterable<Result<TimeBoundaryResultValue>> buildResult(DateTime timestamp, DateTime min, DateTime max)
|
||||
{
|
||||
List<Result<TimeBoundaryResultValue>> results = Lists.newArrayList();
|
||||
Map<String, Object> result = Maps.newHashMap();
|
||||
|
||||
if (min != null) {
|
||||
result.put(MIN_TIME, min);
|
||||
}
|
||||
if (max != null) {
|
||||
result.put(MAX_TIME, max);
|
||||
}
|
||||
if (!result.isEmpty()) {
|
||||
results.add(new Result<>(timestamp, new TimeBoundaryResultValue(result)));
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
public Iterable<Result<TimeBoundaryResultValue>> mergeResults(List<Result<TimeBoundaryResultValue>> results)
|
||||
{
|
||||
if (results == null || results.isEmpty()) {
|
||||
|
|
Loading…
Reference in New Issue