FLATTEN function

FLATTEN function

Function Name Description Usage Input parameter Return value
FLATTEN Flattens a JSON array recursively to create a new one-dimensional array. FLATTEN() N/A A flattened JSON array.

Supported data type

The FLATTEN function supports the following data type:

  • JSON

Example: Flatten a nested JSON array

Sample data: $var1$ = [[1, 2], [3, 4]]

Usage: $var1$.FLATTEN()

Flatten var1.

Output: [1, 2, 3 ,4]

Recommendation

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年12月09日 UTC.