hanyuzheng7 opened a new pull request, #22785:
URL: https://github.com/apache/flink/pull/22785
## What is the purpose of the change
This is an implementation of ARRAY_JOIN
## Brief change log
Returns a string that represents the concatenation of the elements in the
given array and the elements' data type in the given array is string. The
delimiter is a string that separates each pair of consecutive elements of the
array. The optional nullReplacement is a string that replaces null elements in
the array. If nullReplacement is not specified, null elements in the array will
be omitted from the resulting string. Returns null if the input array is null.
- Syntax:
`array_join(array, delimiter, [, null_replacement])`
- Arguments:
array: An ARRAY to be handled.
delimiter: A STRING used to separate the concatenated array elements.
null_replacement: A STRING used to express a NULL value in the result. It is
a optional
- Return:
A STRING where the elements of array are separated by delimiter and null
elements are substituted for null_replacement. If null_replacement parameter is
not provided, null elements are filtered out.
- Examples:
```
> SELECT array_join(array('hello', 'world'), ' ');
hello world
> SELECT array_join(array('hello', NULL ,'world'), ' ');
hello world
> SELECT array_join(array('hello', NULL ,'world'), ' ', ',');
hello , world
```
- See also:
spark - https://spark.apache.org/docs/latest/api/sql/index.html#array_join
presto - https://prestodb.io/docs/current/functions/array.html
## Verifying this change
- This change added tests in CollectionFunctionsITCase.
## 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)
--
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]