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:41:00 UTC

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

|  ![](cid:jira-generated-image-avatar-56b903b6-0df8-4c49-aef2-8227c025fcce) |
[Marco](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=matar993)
**created** an issue  
---|---  
|  
---  
|  [Spark](https://issues.apache.org/jira/browse/SPARK) / [![New
Feature](cid:jira-generated-image-
avatar-40464535-5e1d-4a69-9d51-24215ff96f3a)](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)  
| Issue Type: |  ![New Feature](cid:jira-generated-image-
avatar-40464535-5e1d-4a69-9d51-24215ff96f3a) New Feature  
---|---  
Affects Versions: |  3.3.0  
Assignee: |  Unassigned  
Components: |  SQL, Tests  
Created: |  29/Jun/22 13:40  
Priority: |  ![Minor](cid:jira-generated-image-static-
minor-584f80d3-6819-469b-bc4a-16e0a7fd9a07) Minor  
Reporter: |
[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:



    
    
    case class CheckEmptyState[K](expectedKey: K) extends StreamAction
    case class CheckNonEmptyState[K, V](expectedKey: K, expectedState: V) extends StreamAction



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-950eea2b-099b-453b-b050-6ecefe3bba76)
](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)  
---