From 4b26ec12b999eb8622cb701f856b55792e848a74 Mon Sep 17 00:00:00 2001 From: Soeren Wolfers Date: Tue, 10 Sep 2024 10:56:58 +0100 Subject: [PATCH] Update struct.md moved the note to the right place --- docs/sql/data_types/struct.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sql/data_types/struct.md b/docs/sql/data_types/struct.md index 0db4629e022..4996327d03d 100644 --- a/docs/sql/data_types/struct.md +++ b/docs/sql/data_types/struct.md @@ -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 @@ -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