You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "jackylau (Jira)" <ji...@apache.org> on 2023/04/03 04:12:00 UTC

[jira] [Updated] (FLINK-31691) Add MAP_FROM_ENTRIES supported in SQL & Table API

     [ https://issues.apache.org/jira/browse/FLINK-31691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

jackylau updated FLINK-31691:
-----------------------------
    Description: 
map_from_entries(map) - Returns a map created from an arrays of row with two fields. Note that the number of fields in a row array should be 2 and the key of a row array should not be null.

Syntax:
map_from_entries(array_of_rows)

Arguments:
array_of_rows: an arrays of row with two fields.

Returns:

Returns a map created from an arrays of row with two fields. Note that the number of fields in a row array should be 2 and the key of a row array should not be null.

Returns null if the argument is null
{code:sql}
> SELECT map_from_entries(map[1, 'a', 2, 'b']);
 [(1,"a"),(2,"b")]{code}
See also
presto [https://prestodb.io/docs/current/functions/map.html]

spark https://spark.apache.org/docs/latest/api/sql/index.html#map_from_entries

> Add MAP_FROM_ENTRIES supported in SQL & Table API
> -------------------------------------------------
>
>                 Key: FLINK-31691
>                 URL: https://issues.apache.org/jira/browse/FLINK-31691
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / Planner
>    Affects Versions: 1.18.0
>            Reporter: jackylau
>            Priority: Major
>             Fix For: 1.18.0
>
>
> map_from_entries(map) - Returns a map created from an arrays of row with two fields. Note that the number of fields in a row array should be 2 and the key of a row array should not be null.
> Syntax:
> map_from_entries(array_of_rows)
> Arguments:
> array_of_rows: an arrays of row with two fields.
> Returns:
> Returns a map created from an arrays of row with two fields. Note that the number of fields in a row array should be 2 and the key of a row array should not be null.
> Returns null if the argument is null
> {code:sql}
> > SELECT map_from_entries(map[1, 'a', 2, 'b']);
>  [(1,"a"),(2,"b")]{code}
> See also
> presto [https://prestodb.io/docs/current/functions/map.html]
> spark https://spark.apache.org/docs/latest/api/sql/index.html#map_from_entries



--
This message was sent by Atlassian Jira
(v8.20.10#820010)