A special DoFn implementation that converts an Iterable of
values into a single value. If a CombineFn instance is used on a
PGroupedTable, the function will be applied to the output of the map
stage before the data is passed to the reducer, which can improve the runtime
of certain classes of jobs.
STRING_CONCAT(String separator,
boolean skipNull,
long maxOutputLength,
long maxInputLength)
Used to concatenate strings, with a separator between each strings.
public static final <K,V> CombineFn<K,V> FIRST_N(int n)
LAST_N
public static final <K,V> CombineFn<K,V> LAST_N(int n)
STRING_CONCAT
public static final <K> CombineFn<K,String> STRING_CONCAT(String separator,
boolean skipNull)
Used to concatenate strings, with a separator between each strings. There
is no limits of length for the concatenated string.
Parameters:
separator - the separator which will be appended between each string
skipNull - define if we should skip null values. Throw
NullPointerException if set to false and there is a null
value.
Returns:
STRING_CONCAT
public static final <K> CombineFn<K,String> STRING_CONCAT(String separator,
boolean skipNull,
long maxOutputLength,
long maxInputLength)
Used to concatenate strings, with a separator between each strings. You
can specify the maximum length of the output string and of the input
strings, if they are > 0. If a value is <= 0, there is no limits.
Any too large string (or any string which would made the output too
large) will be silently discarded.
Parameters:
separator - the separator which will be appended between each string
skipNull - define if we should skip null values. Throw
NullPointerException if set to false and there is a null
value.
maxOutputLength - the maximum length of the output string. If it's set <= 0,
there is no limits. The number of characters of the output
string will be < maxOutputLength.
maxInputLength - the maximum length of the input strings. If it's set <= 0,
there is no limits. The number of characters of the int string
will be < maxInputLength to be concatenated.