简体   繁体   English

是否需要在Flink中使用Windows?

[英]Is it necessary to use windows in Flink?

I'm attempting to transform a stream of data, without using any window provided by Flink. 我正在尝试转换数据流,而不使用Flink提供的任何窗口。 My code looks something like this : 我的代码看起来像这样:

val stream1 = executionEnvironment.getStream
val stream2 = stream1.flatMap(someFunction)

stream2.addSink(s3_Sink)
executionEnvironment.execute()

However, upon submitting and running my job, I'm not getting any output on S3. 但是,提交并运行我的工作后,我在S3上没有任何输出。 The web UI shows 0 bytes received, 0 records received, 0 bytes sent, 0 records sent. Web UI显示已接收0个字节,已接收0个记录,已发送0个字节,已发送0个记录。

Another running Flink job is already using the same data source, so the data source is fine. 另一个正在运行的Flink作业已经在使用相同的数据源,因此该数据源很好。 There are no errors anywhere but still no output. 任何地方都没有错误,但仍然没有输出。 Could this issue be, because I'm not using any window or key operation? 因为我没有使用任何窗口或键操作,所以可能是这个问题吗? I attempted to get the output after assigning ascending timestamps but didn't get any output. 分配了递增时间戳后,我尝试获取输出,但未获得任何输出。 Any idea of what could not be working? 有什么想法是行不通的吗?

I guess that has nothing to do with a missing window. 我想这与缺少窗口无关。 Rule of thumb: Use windows when you want any kind of aggregation (folds, reduces, etc.). 经验法则:当您需要任何类型的汇总(折叠,缩小等)时,请使用窗口。

Regarding you initial problem: From what you have shown so far I can only imagine that the flatMap operator doesn't produces any output (in contrast to a map which always have to emit a value flatMap might filter out everything). 关于您的最初问题:从目前为止所显示的内容,我只能想象flatMap运算符不会产生任何输出(与始终必须发出值flatMap的地图相反,它可能会过滤掉所有内容)。 Maybe you can add more code so that we can have a closer look. 也许您可以添加更多代码,以便我们仔细看一下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM