mirror of https://github.com/apache/druid.git
commit
df4604c392
|
@ -13,6 +13,15 @@ Druid supports the following types of having clauses.
|
||||||
The simplest having clause is a numeric filter.
|
The simplest having clause is a numeric filter.
|
||||||
Numeric filters can be used as the base filters for more complex boolean expressions of filters.
|
Numeric filters can be used as the base filters for more complex boolean expressions of filters.
|
||||||
|
|
||||||
|
Here's an example of a having-clause numeric filter:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "greaterThan",
|
||||||
|
"aggregation": "myAggMetric",
|
||||||
|
"value": 100
|
||||||
|
}
|
||||||
|
|
||||||
#### Equal To
|
#### Equal To
|
||||||
|
|
||||||
The equalTo filter will match rows with a specific aggregate value.
|
The equalTo filter will match rows with a specific aggregate value.
|
||||||
|
@ -21,7 +30,7 @@ The grammar for an `equalTo` filter is as follows:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"type": "equalTo",
|
"type": "equalTo",
|
||||||
"aggregation": <aggregate_metric>,
|
"aggregation": "<aggregate_metric>",
|
||||||
"value": <numeric_value>
|
"value": <numeric_value>
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -36,7 +45,7 @@ The grammar for a `greaterThan` filter is as follows:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"type": "greaterThan",
|
"type": "greaterThan",
|
||||||
"aggregation": <aggregate_metric>,
|
"aggregation": "<aggregate_metric>",
|
||||||
"value": <numeric_value>
|
"value": <numeric_value>
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -51,7 +60,7 @@ The grammar for a `greaterThan` filter is as follows:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"type": "lessThan",
|
"type": "lessThan",
|
||||||
"aggregation": <aggregate_metric>,
|
"aggregation": "<aggregate_metric>",
|
||||||
"value": <numeric_value>
|
"value": <numeric_value>
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -30,14 +30,14 @@ There are several main parts to a search query:
|
||||||
|
|
||||||
|property|description|required?|
|
|property|description|required?|
|
||||||
|--------|-----------|---------|
|
|--------|-----------|---------|
|
||||||
|queryType|This String should always be "search"; this is the first thing Druid looks at to figure out how to interpret the query|yes|
|
|queryType|This String should always be "search"; this is the first thing Druid looks at to figure out how to interpret the query.|yes|
|
||||||
|dataSource|A String defining the data source to query, very similar to a table in a relational database|yes|
|
|dataSource|A String defining the data source to query, very similar to a table in a relational database.|yes|
|
||||||
|granularity|Defines the granularity of the query. See [Granularities](Granularities.html)|yes|
|
|granularity|Defines the granularity of the query. See [Granularities](Granularities.html).|yes|
|
||||||
|filter|See [Filters](Filters.html)|no|
|
|filter|See [Filters](Filters.html).|no|
|
||||||
|intervals|A JSON Object representing ISO-8601 Intervals. This defines the time ranges to run the query over.|yes|
|
|intervals|A JSON Object representing ISO-8601 Intervals. This defines the time ranges to run the query over.|yes|
|
||||||
|searchDimensions|The dimensions to run the search over. Excluding this means the search is run over all dimensions.|no|
|
|searchDimensions|The dimensions to run the search over. Excluding this means the search is run over all dimensions.|no|
|
||||||
|query|See [SearchQuerySpec](SearchQuerySpec.html).|yes|
|
|query|See [SearchQuerySpec](SearchQuerySpec.html).|yes|
|
||||||
|sort|How the results of the search should be sorted. Two possible types here are "lexicographic" and "strlen".|yes|
|
|sort|An object specifying how the results of the search should be sorted. Two possible types here are "lexicographic" (the default sort) and "strlen".|no|
|
||||||
|context|An additional JSON Object which can be used to specify certain flags.|no|
|
|context|An additional JSON Object which can be used to specify certain flags.|no|
|
||||||
|
|
||||||
The format of the result is:
|
The format of the result is:
|
||||||
|
|
Loading…
Reference in New Issue