Skip to content

Commit

Permalink
docs: remove experimental note from unnest docs (apache#15123)
Browse files Browse the repository at this point in the history
* docs: remove experimental note from unnest docs

* remove flag needed to use unnest
  • Loading branch information
317brian authored and ektravel committed Oct 16, 2023
1 parent 28f6f29 commit 37cec5f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 23 deletions.
5 changes: 0 additions & 5 deletions docs/querying/datasource.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,6 @@ future versions:

### `unnest`

:::info
The unnest datasource is [experimental](../development/experimental.md). Its API and behavior are subject
to change in future releases. It is not recommended to use this feature in production at this time.
:::

Use the `unnest` datasource to unnest a column with multiple values in an array.
For example, you have a source column that looks like this:

Expand Down
6 changes: 0 additions & 6 deletions docs/querying/sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ documentation.

## UNNEST

:::info
The UNNEST SQL function is [experimental](../development/experimental.md). Its API and behavior are subject
to change in future releases. It is not recommended to use this feature in production at this time.
:::

The UNNEST clause unnests array values. It's the SQL equivalent to the [unnest datasource](./datasource.md#unnest). The source for UNNEST can be an array or an input that's been transformed into an array, such as with helper functions like MV_TO_ARRAY or ARRAY.

The following is the general syntax for UNNEST, specifically a query that returns the column that gets unnested:
Expand All @@ -110,7 +105,6 @@ SELECT column_alias_name FROM datasource CROSS JOIN UNNEST(source_expression1) A

Keep the following things in mind when writing your query:

- You must include the context parameter `"enableUnnest": true`.
- You can unnest multiple source expressions in a single query.
- Notice the CROSS JOIN between the datasource and the UNNEST function. This is needed in most cases of the UNNEST function. Specifically, it is not needed when you're unnesting an inline array since the array itself is the datasource.
- If you view the native explanation of a SQL UNNEST, you'll notice that Druid uses `j0.unnest` as a virtual column to perform the unnest. An underscore is added for each unnest, so you may notice virtual columns named `_j0.unnest` or `__j0.unnest`.
Expand Down
12 changes: 0 additions & 12 deletions docs/tutorials/tutorial-unnest-arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ import TabItem from '@theme/TabItem';
If you're looking for information about how to unnest `COMPLEX<json>` columns, see [Nested columns](../querying/nested-columns.md).
:::

:::info
The unnest datasource and UNNEST SQL function are [experimental](../development/experimental.md). Their API and behavior are subject
to change in future releases. It is not recommended to use this feature in production at this time.
:::

This tutorial demonstrates how to use the unnest datasource to unnest a column that has data stored in arrays. For example, if you have a column named `dim3` with values like `[a,b]` or `[c,d,f]`, the unnest datasource can output the data to a new column with individual rows that contain single values like `a` and `b`. When doing this, be mindful of the following:

- Unnesting data can dramatically increase the total number of rows.
Expand Down Expand Up @@ -166,12 +161,6 @@ The following is the general syntax for UNNEST:
SELECT column_alias_name FROM datasource CROSS JOIN UNNEST(source_expression) AS table_alias_name(column_alias_name)
```

In addition, you must supply the following context parameter:

```json
"enableUnnest": "true"
```

For more information about the syntax, see [UNNEST](../querying/sql.md#unnest).

### Unnest a single source expression in a datasource
Expand Down Expand Up @@ -645,7 +634,6 @@ The following Scan query unnests the column `dim3` into `d3` and a virtual colum
],
"legacy": false,
"context": {
"enableUnnest": "true",
"queryId": "2618b9ce-6c0d-414e-b88d-16fb59b9c481",
"sqlOuterLimit": 1001,
"sqlQueryId": "2618b9ce-6c0d-414e-b88d-16fb59b9c481",
Expand Down

0 comments on commit 37cec5f

Please sign in to comment.