Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs to document breaking change in explain attributes #16031

Merged
merged 3 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For 29.0.0, could you also please update targetDataSource format in this doc to the JSON object in these example EXPLAIN PLAN outputs here and here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

- `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
Loading