diff --git a/docs/sql/functions/nested.md b/docs/sql/functions/nested.md index 02e12c866e5..47c59dc27d7 100644 --- a/docs/sql/functions/nested.md +++ b/docs/sql/functions/nested.md @@ -344,8 +344,14 @@ SELECT [[1, 2], [3, 4], [5, 6], [7, 8]] ``` -The behavior of the flatten function also has specific behavior when handling `NULL` values: +In general, the input to the flatten function should be a list of lists (not a single level list). +However, the behavior of the flatten function has specific behavior when handling empty lists and `NULL` values. ```sql +-- If the input list is empty, return an empty list +SELECT flatten([]); +---- +[] + -- If the entire input to flatten is NULL, return NULL SELECT flatten(NULL); ----