Apache Presto - 数组运算符

以下是数组运算符的类型。

数组下标[]运算符

查询

presto:default> select array[1,2,3] as array_elements; 

结果

array_elements 
---------------- 
 [1, 2, 3] 

数组下标运算符返回数组元素。

数组串联运算符

查询

presto:default> select array[1,2,3] || array[4] as array_concat; 

结果

 array_concat 
-------------- 
 [1, 2, 3, 4]

此处,两个数组与一个数组连接在一起。

apache_presto_basic_sql_operations.html