Hi Timo, The window function sinks the data into InfluxDB, and it's not triggered. If I comment the ".timeWindow", and print results after the reduce function, it works Code for window function is here:
private static class WindowFunImpl implements WindowFunction<KVTuple6,Point,Tuple,TimeWindow> { @Override public void apply(Tuple tuple, TimeWindow window, Iterable<KVTuple6> iterable, Collector<Point> collector) throws Exception { KVTuple6 kvTypeTuple = iterable.iterator().next(); System.out.println("window: " + kvTypeTuple); // Doesn't work here if use broadcast Point.Builder builder = Point.measurement(INFLUXDB_MEASUREMENT) .time(window.getStart(), TimeUnit.MILLISECONDS) .tag(TAG_DOMAIN, kvTypeTuple.f0) .tag(TAG_DEVICE, kvTypeTuple.f1) .tag(TAG_TYPE, kvTypeTuple.f2) .tag(TAG_KEY, kvTypeTuple.f3) .addField(FIELD, kvTypeTuple.f4); collector.collect(builder.build()); } } On Wed, Mar 8, 2017 at 1:10 AM, Timo Walther <twal...@apache.org> wrote: > Hi Sam, > > could you explain the behavior a bit more? How does the window function > behave? Is it not triggered or what is the content? What is the result if > you don't use a window function? > > Timo > > > Am 08/03/17 um 02:59 schrieb Sam Huang: > > btw, the reduce function works well, I've printed out the data, and they >> are >> all correct. So are the timestamps and watermarks. And if I remove >> ".broadcast()", the data is successfully sinked. >> >> Any help? >> >> >> >> -- >> View this message in context: http://apache-flink-user-maili >> ng-list-archive.2336050.n4.nabble.com/window-function-not >> -working-when-control-stream-broadcast-tp12093p12094.html >> Sent from the Apache Flink User Mailing List archive. mailing list >> archive at Nabble.com. >> > > >