Skip to content

Conversation

@hanyuzheng7
Copy link
Contributor

What is the purpose of the change

This is an implementation of MAP_UNION

Returns a map created by merging at least one map. These maps should have a common map type. If there are overlapping keys, the value from 'map2' will overwrite the value from 'map1', the value from 'map3' will overwrite the value from 'map2', the value from 'mapn' will overwrite the value from 'map(n-1)'. If any of maps is null, return null.

Brief change log

MAP_UNION for Table API and SQL

  • Syntax:
    MAP_UNION(map1, ...)
  • Arguments:
    map1:The first map to be merged.
    map2:The second map to be merged.
    mapn: the n map to be merged
  • Returns: If there are overlapping keys, the value from 'map2' will overwrite the value from 'map1', the value from 'map3' will overwrite the value from 'map2', the value from 'mapn' will overwrite the value from 'map(n-1)'. If any of maps is null, return null.
  • Examples:

Merging maps with unique keys:

map1 = ['a': 1, 'b': 2] map2 = ['c': 3, 'd': 4] 
map_union(map1, map2)  
Output: ['a': 1, 'b': 2, 'c': 3, 'd': 4]

Merging maps with overlapping keys:

map1 = ['a': 1, 'b': 2] map2 = ['b': 3, 'c': 4] 
map_union(map1, map2) 
Output: ['a': 1, 'b': 3, 'c': 4]

Verifying this change

  • This change added tests in MapFunctionITCase.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@flinkbot
Copy link
Collaborator

flinkbot commented Aug 5, 2023

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@MartijnVisser
Copy link
Contributor

Closing this PR since we don't backport new features into existing releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants