I have JSON data with with a nested list and am using FLATTEN to extract two of three list elements as:

~~~
SELECT id, FLATTEN(data)[0] AS dttm, FLATTEN(data)[1] AS result FROM ...
~~~

This works, but each FLATTEN seems to slow the query down dramatically, 3x slower with the second flatten.

Is there a better approach to extracting list elements?

~~~
[
  {
    "id": 16,
    "data": [
      [
        "2016-07-13 00:00",
        509,
        "OK"
      ],
      [
        "2016-07-13 00:01",
        461,
        "OK"
      ],
      [
        "2016-07-13 00:02",
        508,
        "OK"
      ],
~~~

Reply via email to