gaborgsomogyi commented on a change in pull request #30427:
URL: https://github.com/apache/spark/pull/30427#discussion_r526907069
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/StreamingQueryStatisticsPage.scala
##########
@@ -126,6 +126,54 @@ private[ui] class StreamingQueryStatisticsPage(parent:
StreamingQueryTab)
<br />
}
+ def generateWatermark(
+ query: StreamingQueryUIData,
+ minBatchTime: Long,
+ maxBatchTime: Long,
+ jsCollector: JsCollector): NodeBuffer = {
Review comment:
Now sure what complications it would mean in `generateStatTable` but I
think we can give back `Node` here.
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/StreamingQueryStatisticsPage.scala
##########
@@ -126,6 +126,54 @@ private[ui] class StreamingQueryStatisticsPage(parent:
StreamingQueryTab)
<br />
}
+ def generateWatermark(
+ query: StreamingQueryUIData,
+ minBatchTime: Long,
+ maxBatchTime: Long,
+ jsCollector: JsCollector): NodeBuffer = {
+ // This is made sure on caller side but put it here to be defensive
+ require(query.lastProgress != null)
+ if (query.lastProgress.eventTime.containsKey("watermark")) {
+ val watermarkData = query.recentProgress.flatMap { p =>
+ val batchTimestamp = parseProgressTimestamp(p.timestamp)
+ val watermarkValue =
parseProgressTimestamp(p.eventTime.get("watermark"))
+ if (watermarkValue > 0L) {
+ // seconds
+ Some((batchTimestamp, ((batchTimestamp - watermarkValue) / 1000.0)))
+ } else {
+ None
+ }
+ }
+ val maxWatermark = watermarkData.maxBy(_._2)._2
+ val graphUIDataForWatermark =
+ new GraphUIData(
+ "watermark-gap-timeline",
+ "watermark-gap-histogram",
+ watermarkData,
+ minBatchTime,
+ maxBatchTime,
+ 0,
+ maxWatermark,
+ "seconds")
+ graphUIDataForWatermark.generateDataJs(jsCollector)
+
+ // scalastyle:off
+ new NodeBuffer() &+
+ <tr>
+ <td style="vertical-align: middle;">
+ <div style="width: 160px;">
+ <div><strong>Global Watermark Gap {SparkUIUtils.tooltip("The gap
between timestamp and global watermark for the batch.", "right")}</strong></div>
Review comment:
I understand that `timestamp` here means now but maybe we can more
explicit.
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/UISeleniumSuite.scala
##########
@@ -51,6 +53,7 @@ class UISeleniumSuite extends SparkFunSuite with WebBrowser
with Matchers with B
val conf = new SparkConf()
.setMaster(master)
.setAppName("ui-test")
+ .set(SHUFFLE_PARTITIONS, 5)
Review comment:
Just curious, is this to speed up the unit test not to start 200 tasks?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]