Github user kunalkhamar commented on a diff in the pull request:
https://github.com/apache/spark/pull/17216#discussion_r106267528
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/StreamExecution.scala
---
@@ -437,25 +464,28 @@ class StreamExecution(
}
}
if (hasNewData) {
- // Current batch timestamp in milliseconds
- offsetSeqMetadata.batchTimestampMs = triggerClock.getTimeMillis()
+ var batchWatermarkMs = offsetSeqMetadata.batchWatermarkMs
// Update the eventTime watermark if we find one in the plan.
if (lastExecution != null) {
lastExecution.executedPlan.collect {
case e: EventTimeWatermarkExec if e.eventTimeStats.value.count >
0 =>
logDebug(s"Observed event time stats:
${e.eventTimeStats.value}")
e.eventTimeStats.value.max - e.delayMs
}.headOption.foreach { newWatermarkMs =>
- if (newWatermarkMs > offsetSeqMetadata.batchWatermarkMs) {
+ if (newWatermarkMs > batchWatermarkMs) {
logInfo(s"Updating eventTime watermark to: $newWatermarkMs ms")
- offsetSeqMetadata.batchWatermarkMs = newWatermarkMs
+ batchWatermarkMs = newWatermarkMs
} else {
logDebug(
s"Event time didn't move: $newWatermarkMs < " +
- s"${offsetSeqMetadata.batchWatermarkMs}")
+ s"$batchWatermarkMs")
}
}
}
+ offsetSeqMetadata = OffsetSeqMetadata(
--- End diff --
Good point, changed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]