You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Marco (Jira)" <ji...@apache.org> on 2022/06/29 13:42:00 UTC

[jira] [Updated] (SPARK-39632) add state utils to StreamTest to check states during streaming queries

|  ![](cid:jira-generated-image-avatar-b8187233-bdc2-4b8c-8535-c4ede107392b) |
[Marco](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=matar993)
**updated** an issue  
---|---  
|  
---  
|  [Spark](https://issues.apache.org/jira/browse/SPARK) / [![New
Feature](cid:jira-generated-image-
avatar-339ae762-1f9a-4420-8237-3e087183d02e)](https://issues.apache.org/jira/browse/SPARK-39632)
[SPARK-39632](https://issues.apache.org/jira/browse/SPARK-39632)  
---  
[add state utils to StreamTest to check states during streaming
queries](https://issues.apache.org/jira/browse/SPARK-39632)  
| Change By: |
[Marco](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=matar993)  
---|---  
|  The framework for implementing tests for streaming queries
([StreamTest|https://github.com/apache/spark/blob/master/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala])
doesn't have any StreamActions that allows to check the state for a specific
key during a stateful streaming query.  
  
For this purpose, two new Stream Actions need to be implemented:  
  
  
{code:java}  
case class CheckEmptyState[K](expectedKey: K) extends StreamAction  
case class CheckNonEmptyState[K, V](expectedKey: K, expectedState: V) extends
StreamAction{code}  
  
  
The CheckEmptyState StreamAction will check if doesn't exists a state for the
specified key.  
  
The CheckNonEmptyState StreamAction will check if there is a state of type V,
for the specified key, which is equal to the specified state.  
---  
|  |  [ ![Add Comment](cid:jira-generated-image-static-comment-
icon-7e270f8d-5dc5-4454-9ddf-a528830245f1)
](https://issues.apache.org/jira/browse/SPARK-39632#add-comment "Add Comment")
|  [Add Comment](https://issues.apache.org/jira/browse/SPARK-39632#add-comment
"Add Comment")  
---|---  
  
|  This message was sent by Atlassian Jira (v8.20.10#820010-sha1:ace47f9) |  |
![Atlassian logo](https://issues.apache.org/jira/images/mail/atlassian-email-
logo.png)  
---