hanyuzheng7 opened a new pull request, #23098:
URL: https://github.com/apache/flink/pull/23098

   Implement the map_entries method to transform a map into an array of 
key-value structs in release-1.17.
   
   Description: The current implementation of the map_entries method in the 
Flink library does not provide a way to transform a map into an array of 
key-value structs. This enhancement aims to add this functionality, allowing 
users to convert a map into a more structured format for further processing.
   
   Syntax:
   `map_entries[map: Map[K, V]] -> Array[Struct<K, V>] `
   
   Arguments:
   
   map: The input map to be transformed.
   
   Returns: An array of key-value structs obtained from the input map. Each 
struct consists of two fields: key of type K and value of type V.
   
   Examples:
   
   Transforming a map into key-value structs:
   
    
    
   
   input_map = [1: 'apple', 2: 'banana', 3: 'cherry'] 
    map_entries[input_map] 
    Output: [{'key': 1, 'value': 'apple'}, {'key': 2, 'value': 'banana'}, 
{'key': 3, 'value': 'cherry'}]
   Handling an empty map:
   empty_map = {} 
   map_entries[empty_map]
   Output: []
   
   See also:
   
   spark:https://spark.apache.org/docs/latest/api/sql/index.html#map_entries


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to