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, postAggregationsfilter, granularity, intervalscontext, 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, withPostAggregationsgetAggregations, getDimensions, getPostAggregationsgetFilter, getIntervalsgetContext, getDataSource, getQueryTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuildSchemaColumns, getDependentFieldNames, getInnermostQuery, getInnerQuery, getMetricDimensionsgetFilter, getIntervalsgetContext, getDataSource, getQueryTypepublic 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()
DruidFactQuerygetGranularity 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_VALUECopyright © 2016–2018 Yahoo! Inc.. All rights reserved.