mirror of https://github.com/apache/druid.git
1) Make GroupByQuery not require a limit clause
2) Make DefaultLimitSpec not require the "limit" field to be specified in JSON 3) Move a log line in Announcer to debug
This commit is contained in:
parent
de720e6e1a
commit
cdd8f78ed3
|
@ -137,7 +137,7 @@ public class Announcer
|
|||
@Override
|
||||
public void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws Exception
|
||||
{
|
||||
log.info("Path[%s] got event[%s]", parentPath, event);
|
||||
log.debug("Path[%s] got event[%s]", parentPath, event);
|
||||
switch (event.getType()) {
|
||||
case CHILD_REMOVED:
|
||||
final ChildData child = event.getData();
|
||||
|
|
|
@ -39,6 +39,7 @@ import com.metamx.druid.query.dimension.DimensionSpec;
|
|||
import com.metamx.druid.query.filter.DimFilter;
|
||||
import com.metamx.druid.query.group.limit.DefaultLimitSpec;
|
||||
import com.metamx.druid.query.group.limit.LimitSpec;
|
||||
import com.metamx.druid.query.group.limit.NoopLimitSpec;
|
||||
import com.metamx.druid.query.group.limit.OrderByColumnSpec;
|
||||
import com.metamx.druid.query.segment.LegacySegmentSpec;
|
||||
import com.metamx.druid.query.segment.QuerySegmentSpec;
|
||||
|
@ -78,7 +79,7 @@ public class GroupByQuery extends BaseQuery<Row>
|
|||
)
|
||||
{
|
||||
super(dataSource, querySegmentSpec, context);
|
||||
this.limitSpec = (limitSpec == null) ? new DefaultLimitSpec() : limitSpec;
|
||||
this.limitSpec = (limitSpec == null) ? new NoopLimitSpec() : limitSpec;
|
||||
this.dimFilter = dimFilter;
|
||||
this.granularity = granularity;
|
||||
this.dimensions = dimensions == null ? ImmutableList.<DimensionSpec>of() : dimensions;
|
||||
|
|
|
@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Ordering;
|
||||
import com.google.common.primitives.Longs;
|
||||
|
@ -50,21 +49,15 @@ public class DefaultLimitSpec implements LimitSpec
|
|||
@JsonCreator
|
||||
public DefaultLimitSpec(
|
||||
@JsonProperty("orderBy") List<OrderByColumnSpec> orderBy,
|
||||
@JsonProperty("limit") int limit
|
||||
@JsonProperty("limit") Integer limit
|
||||
)
|
||||
{
|
||||
this.orderBy = (orderBy == null) ? ImmutableList.<OrderByColumnSpec>of() : orderBy;
|
||||
this.limit = limit;
|
||||
this.limit = (limit == null) ? Integer.MAX_VALUE : limit;
|
||||
|
||||
Preconditions.checkState(limit > 0, "limit[%s] must be >0", limit);
|
||||
}
|
||||
|
||||
public DefaultLimitSpec()
|
||||
{
|
||||
this.orderBy = Lists.newArrayList();
|
||||
this.limit = 0;
|
||||
}
|
||||
|
||||
@JsonProperty
|
||||
public List<OrderByColumnSpec> getOrderBy()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue