Neil Ramaswamy created SPARK-50301:
--------------------------------------
Summary: TransformWithState metrics incorrectly counts the time
for state removal
Key: SPARK-50301
URL: https://issues.apache.org/jira/browse/SPARK-50301
Project: Spark
Issue Type: Improvement
Components: Structured Streaming
Affects Versions: 4.0.0
Reporter: Neil Ramaswamy
In TWS, we use the streaming query progress metric `allRemovalsTimeMs` to
actually count the amount of time it takes to process the user's timers. This
is inconsistent with the other stateful operators, which use
`allRemovalsTimeMs` to count the amount of time needed to remove state. The
mis-labelling of the metric happens
[here|https://github.com/apache/spark/blob/05508cf7cb9da3042fa4b17645102a6406278695/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/TransformWithStateExec.scala#L346].
Note that this likely resulted as a copy-paste bug, since
`flatMapGroupsWithState` has the same bug
[here|https://github.com/apache/spark/blob/05508cf7cb9da3042fa4b17645102a6406278695/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/FlatMapGroupsWithStateExec.scala#L132].
We should fix that too.
Additionally, TWS uses `commitTimeMs` to capture the amount of time taken to
perform state removal due to TTL. This is incorrect; this should actually be
part of `allRemovalsTimeMs`.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]