Fonction array

S’applique à : oui coché Databricks SQL oui coché Databricks Runtime 10.5 et versions ultérieures

Retourne un tableau avec les éléments contenus dans expr.

Syntaxe

array(expr [, ...])

Arguments

  • exprN : éléments de tout type partageant un moindre type commun.

Retours

Tableau d’éléments de moindre type commun exprNs.

Si le tableau est vide ou si tous les éléments ont la valeur NULL, le type de résultat est un tableau de type null.

Exemples

-- an array of integers
> SELECT array(1, 2, 3);
 [1,2,3]
-- an array of strings
> SELECT array(1.0, 1, 'hello');
 [1.0,1,hello]