Skip to content

Commit

Permalink
Update struct.md
Browse files Browse the repository at this point in the history
moved the note to the right place
  • Loading branch information
soerenwolfers authored Sep 10, 2024
1 parent d28acd3 commit 4b26ec1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/sql/data_types/struct.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ FROM
Mismatch Type Error: Type STRUCT(x INTEGER) does not match with STRUCT(y INTEGER). Cannot cast STRUCTs - element "x" in source struct was not found in target struct
```

> This behavior was introduced in DuckDB v0.9.0. Previously, this query ran successfully and returned struct `{'y': 42}` as column `b`.
A workaround for this is to use [`struct_pack`](#creating-structs) instead:

```sql
Expand All @@ -210,8 +212,6 @@ FROM
(SELECT {'x': 42} AS a);
```

> This behavior was introduced in DuckDB v0.9.0. Previously, this query ran successfully and returned struct `{'y': 42}` as column `b`.
The `row` function can be used to return unnamed structs. For example:

```sql
Expand Down

0 comments on commit 4b26ec1

Please sign in to comment.