Skip to content

Commit 49bba6f

Browse files
authored
Merge pull request #336 from InterestingLab/rickyhuo.enhance.streaming
Do not process output if dataset is empty
2 parents 34dff5e + 4d5ecd8 commit 49bba6f

File tree

1 file changed

+5
-3
lines changed
  • waterdrop-core/src/main/scala/io/github/interestinglab/waterdrop

1 file changed

+5
-3
lines changed

waterdrop-core/src/main/scala/io/github/interestinglab/waterdrop/Waterdrop.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,11 @@ object Waterdrop extends Logging {
154154

155155
streamingInputs(0).beforeOutput
156156

157-
outputs.foreach(p => {
158-
p.process(ds)
159-
})
157+
if (ds.take(1).length > 0) {
158+
outputs.foreach(p => {
159+
p.process(ds)
160+
})
161+
}
160162

161163
streamingInputs(0).afterOutput
162164

0 commit comments

Comments
 (0)