summaryrefslogtreecommitdiffstats
path: root/yql/essentials/docs/en/syntax
diff options
context:
space:
mode:
authorrobot-piglet <[email protected]>2025-07-07 15:25:40 +0300
committerrobot-piglet <[email protected]>2025-07-07 15:49:57 +0300
commit0e4dd8bb5d401ba0cd8bf5751dcf9fd2e054eaef (patch)
treea5e8089fdd03bdf1e00fa8611e3035cb32d699a7 /yql/essentials/docs/en/syntax
parent7b5e0194f5ddeab1c864112b1716b70b969ac7b2 (diff)
Intermediate changes
commit_hash:5a3888997f606a4dec72243c6f80a42a8e44021b
Diffstat (limited to 'yql/essentials/docs/en/syntax')
-rw-r--r--yql/essentials/docs/en/syntax/flatten.md14
1 files changed, 9 insertions, 5 deletions
diff --git a/yql/essentials/docs/en/syntax/flatten.md b/yql/essentials/docs/en/syntax/flatten.md
index f6978fa41d0..0dd81ceed4c 100644
--- a/yql/essentials/docs/en/syntax/flatten.md
+++ b/yql/essentials/docs/en/syntax/flatten.md
@@ -125,21 +125,25 @@ SELECT * FROM (
## FLATTEN COLUMNS {#flatten-columns}
-Converts a table where all columns must be structures to a table with columns corresponding to each element of each structure from the source columns.
-The names of the source column structures are not used and not returned in the result. Be sure that the structure element names aren't repeated in the source columns.
+
+Transforms each column of type `Struct` into individual columns, one for each field within the struct. The names of the new columns are the names of the fields from the original struct columns. Columns that are not structs remain unchanged.
+
+- Only one level of the struct is flattened.
+- The original struct columns are not included in the result; their names are not used anywhere.
+- All column names in the resulting table (including names from struct fields in the original columns and names of non-struct columns) must be unique; name conflicts result in an error.
#### Example
```yql
-SELECT x, y, z
+SELECT x, y, z, not_struct
FROM (
SELECT
AsStruct(
1 AS x,
"foo" AS y),
AsStruct(
- false AS z)
+ false AS z),
+ 1 as not_struct,
) FLATTEN COLUMNS;
```
-