Skip to content
Permalink
Browse files
correct errors on compaction doc (#12308)
  • Loading branch information
vtlim committed Mar 4, 2022
1 parent 3b37311 commit 903174de2045449e12f94d00bdca09ecaf780e64
Showing 1 changed file with 17 additions and 19 deletions.
@@ -95,10 +95,10 @@ To perform a manual compaction, you submit a compaction task. Compaction tasks m
"id": <task_id>,
"dataSource": <task_datasource>,
"ioConfig": <IO config>,
"dimensionsSpec" <custom dimensionsSpec>,
"metricsSpec" <custom metricsSpec>,
"tuningConfig" <parallel indexing task tuningConfig>,
"granularitySpec" <compaction task granularitySpec>,
"dimensionsSpec": <custom dimensionsSpec>,
"metricsSpec": <custom metricsSpec>,
"tuningConfig": <parallel indexing task tuningConfig>,
"granularitySpec": <compaction task granularitySpec>,
"context": <task context>
}
```
@@ -133,28 +133,26 @@ Note that the metadata between input segments and the resulting compacted segmen


### Example compaction task
The following JSON illustrates a compaction task to compact _all segments_ within the interval `2017-01-01/2018-01-01` and create new segments:
The following JSON illustrates a compaction task to compact _all segments_ within the interval `2020-01-01/2021-01-01` and create new segments:

```json
{
"type" : "compact",
"dataSource" : "wikipedia",
"ioConfig" : {
"type": "compact",
"dataSource": "wikipedia",
"ioConfig": {
"type": "compact",
"inputSpec": {
"type": "interval",
"interval": "2020-01-01/2021-01-01",
"interval": "2020-01-01/2021-01-01"
}
},
"granularitySpec": {
"segmentGranularity":"day",
"queryGranularity":"hour"
}
"segmentGranularity": "day",
"queryGranularity": "hour"
}
}
```

This task doesn't specify a `granularitySpec` so Druid retains the original segment granularity unchanged when compaction is complete.

### Compaction I/O configuration

The compaction `ioConfig` requires specifying `inputSpec` as follows:
@@ -203,17 +201,17 @@ Druid supports two supported `inputSpec` formats:
For example, to set the segment granularity to "day", the query granularity to "hour", and enabling rollup:
```json
{
"type" : "compact",
"dataSource" : "wikipedia",
"ioConfig" : {
"type": "compact",
"dataSource": "wikipedia",
"ioConfig": {
"type": "compact",
"inputSpec": {
"type": "interval",
"interval": "2017-01-01/2018-01-01"
},
"granularitySpec": {
"segmentGranularity":"day",
"queryGranularity":"hour",
"segmentGranularity": "day",
"queryGranularity": "hour",
"rollup": true
}
}

0 comments on commit 903174d

Please sign in to comment.