Skip to content

Commit

Permalink
Update docs to document breaking change in explain attributes (#16031)
Browse files Browse the repository at this point in the history
Updates the docs to include a breaking change made regarding the attributes returned by an explain query. The return type of the field targetDataSource was changed to an object instead of a string containing the data source name.

This change is only present in Druid 29, and not in future versions, so it has been documented here. The change has been reverted in future versions here: #16004
  • Loading branch information
adarshsanjeev authored Mar 6, 2024
1 parent 38dfe9d commit 86ee778
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
12 changes: 9 additions & 3 deletions docs/querying/sql-translation.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ EXPLAIN PLAN statements return:
- a `RESOURCES` column that describes the resources used in the query
- an `ATTRIBUTES` column that describes the attributes of the query, including:
- `statementType`: the SQL statement type
- `targetDataSource`: the target datasource in an INSERT or REPLACE statement
- `targetDataSource`: a JSON object representing the target datasource in an INSERT or REPLACE statement
- `partitionedBy`: the time-based partitioning granularity in an INSERT or REPLACE statement
- `clusteredBy`: the clustering columns in an INSERT or REPLACE statement
- `replaceTimeChunks`: the time chunks in a REPLACE statement
Expand Down Expand Up @@ -444,7 +444,10 @@ The above EXPLAIN PLAN returns the following result:
],
{
"statementType": "INSERT",
"targetDataSource": "wikipedia",
"targetDataSource": {
"type":"table",
"tableName":"wikipedia"
},
"partitionedBy": {
"type": "all"
}
Expand Down Expand Up @@ -665,7 +668,10 @@ The above EXPLAIN PLAN query returns the following result:
],
{
"statementType": "REPLACE",
"targetDataSource": "wikipedia",
"targetDataSource": {
"type":"table",
"tableName":"wikipedia"
},
"partitionedBy": "DAY",
"clusteredBy": ["cityName","countryName"],
"replaceTimeChunks": "all"
Expand Down
29 changes: 29 additions & 0 deletions docs/release-info/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,35 @@ Improved the Iceberg extension as follows:

### Upgrade notes

#### Changes in `targetDataSource` payload present in the explain plan for MSQ queries

Druid 29 has a breaking change for EXPLAIN for INSERT/REPLACE MSQ queries.
In the attribute field returned as part of the result for an explain query, the value of the key `targetDataSource` from a string to a JSON object.
This change is only present in Druid 29 and is not present in earlier or later versions.

The JSON object returned plan will have the structure if the target is a datasource:
```json
{
"targetDataSource": {
"type": "table",
"tableName": "wikipedia"
}
}
```

The JSON object returned plan will have the structure if the target is an external export location using :
```json
{
"targetDataSource": {
"type": "external",
"storageConnectorProvider": {
"type": "<export-type>",
"exportPath": "<export-path>"
}
}
}
```

#### Changed `equals` filter for native queries

The [equality filter](https://druid.apache.org/docs/latest/querying/filters#equality-filter) on mixed type `auto` columns that contain arrays must now be filtered as their presenting type. This means that if any rows are arrays (for example, the segment metadata and `information_schema` reports the type as some array type), then the native queries must also filter as if they are some array type.
Expand Down
4 changes: 4 additions & 0 deletions docs/release-info/upgrade-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ For the full release notes for a specific version, see the [releases page](https

### Upgrade notes

#### Changes in `targetDataSource` payload present in the explain plan for MSQ queries

In the attribute field returned as part of the result for an EXPLAIN MSQ query, the value of the key `targetDataSource` from a string to a JSON object. This change is only present in Druid 29 and is not present in earlier or later versions.

#### Changed `equals` filter for native queries

The [equality filter](https://druid.apache.org/docs/latest/querying/filters#equality-filter) on mixed type `auto` columns that contain arrays must now be filtered as their presenting type. This means that if any rows are arrays (for example, the segment metadata and `information_schema` reports the type as some array type), then the native queries must also filter as if they are some array type.
Expand Down

0 comments on commit 86ee778

Please sign in to comment.