Skip to Main Content
Spotfire Ideas Portal
Status To be Reviewed
Categories sql support
Created by Guest
Created on Nov 19, 2025

Add ability to parse arrays of scalar values to JSON_TABLE

Currently, JSON_TABLE supports parsing arrays of JSON objects into rows. That works well, several of the documented examples show how to do that.

Unfortunately, this feature does not currently support parsing arrays of scalar values.

Being able to do so would be very useful to us, for example when we need to parse data where every value in a JSON response corresponds to a quarter of an hour in a given month. Considering that months have variable numbers of days between them, the numbers of array items is vary too. That makes it harder to apply our current approaches using SPLIT_PART or SUBSTRING to achieve the desired result.

Being able to handle this with JSON_TABLE natively would make this much easier, less error prone and would most likely perform better too.


There are examples of similar functionality from Oracle and IBM DB2 that implement this feature. Below example does an attempt to translate that to TDV's syntax:

SELECT
*
FROM JSON_TABLE(
'[-0.9020000000, 0.0380000000, -1.0430000000, 0.1390000000, -1.0840000000, -0.1860000000, -0.4080000000, -1.2560000000, -0.2460000000, -1.2460000000, -0.4380000000]'
, '$[1 to ]'
COLUMNS (
ordinality INTEGER PATH '$.ordinality'
, quantity DECIMAL(14,10) PATH '$.value' -- A guess at the PATH syntax
)
) JT

The ordinality / ord column is an added feature that both Oracle and IBM have, that returns the position of the value in the array.

The result of the above would be a list like so:

1

-0.9020000000

2

0.0380000000

3

-1.0430000000

4

0.1390000000

5

-1.0840000000

6

-0.1860000000

7

-0.4080000000

8

-1.2560000000

9

-0.2460000000

10

-1.2460000000

11

-0.4380000000

  • Attach files