Skip to main content
Skip table of contents

ARRAYTABLE

The ARRAYTABLE function processes an array input to produce tabular output. The function itself defines what columns it projects. The ARRAYTABLE function is implicitly a nested table and may be correlated to preceding FROM clause entries.

Usage

SQL
ARRAYTABLE(expression COLUMNS <COLUMN>, ...) AS name
 
COLUMN := name datatype

Parameters

ParameterDescription
expression

The array to process, should be one of the following:

  • a java.sql.Array;
  • java array value;
  • an array constructed using ARRAY():
CODE
ARRAY('1', 2.2, 3)

 Syntax Rules

  • The column names may not contain duplicates.

Examples

1. As a nested table:

CODE
SELECT x.* FROM (CALL source.invokeMDX('some query')) r, ARRAYTABLE(r.tuple COLUMNS first STRING, second BIGDECIMAL) x

2. Using ARRAY():

SQL
SELECT * FROM ARRAYTABLE(ARRAY('1', 2.2, 3) COLUMNS d STRING, e DOUBLE, f INTEGER) a 
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.