public class WeightEvaluationQuery extends GroupByQuery
Calculates # of sketches times the number rows which will be in result set
{
"queryType": "groupBy",
"dataSource": {
"query": {
"queryType": "groupBy",
"dataSource": {
"name": "basefact_network",
"type": "table"
},
"dimensions": [
"user_device_type",
"pty_country",
"device_type_id"
],
"aggregations": [
{
"name": "ignored",
"type": "count"
}
],
"postAggregations": [
{
"type": "constant",
"name": "count",
"value": 2
}
],
"intervals": [
"2014-09-01T00:00:00.000Z/2014-09-30T00:00:00.000Z"
],
"granularity": {
"type": "period",
"period": "P1D"
}
},
"type": "query"
},
"dimensions": [],
"aggregations": [
{
"name": "count",
"fieldName": "count",
"type": "longSum"
}
],
"postAggregations": [],
"intervals": [
"2014-09-01T00:00:00.000Z/2014-09-30T00:00:00.000Z"
],
"granularity": "all"
}
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_DRUID_TOP_N_THRESHOLD |
aggregations, dimensions, postAggregations
filter, granularity, intervals
context, dataSource, queryType
Constructor and Description |
---|
WeightEvaluationQuery(DruidAggregationQuery<?> query,
int weight)
Generate a query that calculates the even weight of the response cardinality of the given query.
|
Modifier and Type | Method and Description |
---|---|
Granularity |
getGranularity()
Returns the time grain (granularity) of the query.
|
static long |
getWorstCaseWeightEstimate(DruidAggregationQuery<?> query)
Evaluate Druid query for worst possible case expensive aggregation that could bring down Druid.
|
static WeightEvaluationQuery |
makeWeightEvaluationQuery(DruidAggregationQuery<?> query)
Evaluate Druid query for expensive aggregation that could bring down Druid.
|
getHaving, getLimitSpec, withAggregations, withAllIntervals, withContext, withDataSource, withDimensions, withFilter, withGranularity, withHaving, withInnermostDataSource, withIntervals, withLimitSpec, withOrderBy, withPostAggregations
getAggregations, getDimensions, getPostAggregations
getFilter, getIntervals
getContext, getDataSource, getQueryType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
buildSchemaColumns, getDependentFieldNames, getInnermostQuery, getInnerQuery, getMetricDimensions
getFilter, getIntervals
getContext, getDataSource, getQueryType
public static final long DEFAULT_DRUID_TOP_N_THRESHOLD
public WeightEvaluationQuery(DruidAggregationQuery<?> query, int weight)
query
- Query to calculate the weighted response cardinality ofweight
- Weight to apply to each response rowpublic Granularity getGranularity()
DruidFactQuery
getGranularity
in interface DruidFactQuery<GroupByQuery>
getGranularity
in class AbstractDruidFactQuery<GroupByQuery>
public static WeightEvaluationQuery makeWeightEvaluationQuery(DruidAggregationQuery<?> query)
query
- Druid Querypublic static long getWorstCaseWeightEstimate(DruidAggregationQuery<?> query)
Number of Sketches * # of periods in iteration * cardinality of each dimension values
query
- The base query being estimatedArithmeticException
- if the estimate is larger than Long.MAX_VALUE
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.