paul-rogers commented on issue #12546:
URL: https://github.com/apache/druid/issues/12546#issuecomment-1191750836
## Primary Partition
The catalog allows the user to define the ingest partitioning:
```json
{
"dbSchema": "druid",
"name": "fiveMinDs",
"spec": {
"type": "datasource",
"segmentGranularity": "PT5M"
}
}
```
By doing so, the user can drop the `PARTITIONED BY` clause in the `INSERT`
statement as shown above.
Supported values include:
* ISO periods: `PT5M`, `PT1S`
* Names used in "classic" partition specs: `DAY`, `FIVE_MINUTE`
* Descriptive names: `5 minutes`, `6 hours`
Only the standard Druid values are supported: providing a non-standard
interval will raise an error.
## Secondary Partitioning (Clustering)
The multi-stage ingest engine allows the user to specify secondary
partitioning, expressed as the `CLUSTERED BY` clause. The clause includes a
list of cluster *keys*, each of which is an expression and an optional "sort
sense" (`ASC` or `DESC`). The expression is typically a column name, but can be
an expression.
The catalog models this with a list of JSON objects:
```json
{
"dbSchema": "druid",
"name": "fiveMinDs",
"spec": {
"type": "datasource",
"segmentGranularity": "PT5M",
"clusterKeys": [
{"column": "x"},
{"column": "y", "desc": true} ]
}
}
```
At present, the catalog supports only column names: additional work is
needed in the SQL query layer to support expressions. (There is also some
debate about whether the optimizer can correctly use expression columns, and so
whether we actually need them.)
When this information is present in the catalog, the user can omit the
`CLUSTERED BY` clause from an `INSERT` statement.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]