I have a DataStream have different fields that I want to keyBy to do aggregated computation on (count, average, ..)
stream.keyBy("field1").window().aggregate(AggFunc, WindowFunc)...
stream.keyBy("field2").window().aggregate(AggFunc, WindowFunc)...
stream.keyBy("field3").window().aggregate(AggFunc, WindowFunc)...
Is there a way to get name of the keyed field in later WindowFunc ("field1", "field2", "field3")? Note that I want the field name "field1" not the field possible values (this I already have in key in apply function of WindowFunction).
The reason: I want to use the same WindowFunc for 3 aggregations - here I add window_start_time, key_field_name, key_value to the result.
Wanted result example:
-stream keyed on field1
("field1", "field1-val1", 3, window1)
("field1", "field1-val2", 5, window1)
-stream keyed on field2
("field2", "field2-val1", 6, window1)
("field2", "field2-val2", 7, window1)