gustavodemorais commented on code in PR #26113:
URL: https://github.com/apache/flink/pull/26113#discussion_r1955988937


##########
docs/content/docs/dev/table/sql/queries/joins.md:
##########
@@ -326,16 +326,55 @@ FROM Orders AS o
 
 In the example above, the Orders table is enriched with data from the 
Customers table which resides in a MySQL database. The `FOR SYSTEM_TIME AS OF` 
clause with the subsequent processing time attribute ensures that each row of 
the `Orders` table is joined with those Customers rows that match the join 
predicate at the point in time when the `Orders` row is processed by the join 
operator. It also prevents that the join result is updated when a joined 
`Customer` row is updated in the future. The lookup join also requires a 
mandatory equality join predicate, in the example above `o.customer_id = c.id`.
 
-Array Expansion
+Array, Multiset and Map Expansion
 --------------
 
-Returns a new row for each element in the given array. Unnesting `WITH 
ORDINALITY` is not yet supported.
+Unnest returns a new row for each element in the given array, multiset or map. 
Supports both `CROSS JOIN` and `LEFT JOIN`.
+```sql
+-- Returns a new row for each element in a constant array
+SELECT * FROM (VALUES('order_1')), UNNEST(ARRAY["shirt", "pants", "hat"])
+
+id       product_name
+=======  ============
+order_1  shirt
+order_1  pants
+order_1  hat
+
+-- Returns a new row for each element in the array
+-- assuming a Orders table with an array column `product_names`
+SELECT order_id, product_name
+FROM Orders 
+    CROSS JOIN UNNEST(product_names) AS t(product_name)
+```
+
+Unnesting `WITH ORDINALITY` is also supported.
+
 
 ```sql
-SELECT order_id, tag
-FROM Orders CROSS JOIN UNNEST(tags) AS t (tag)
+-- Returns a new row for each element in a constant array and its position in 
the array
+SELECT * 
+FROM (VALUES('order_1'))

Review Comment:
   > it might be easier to understand with a space after VALUES and a second 
value
   
   Extended the example with both notes
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to