ericm-db commented on code in PR #49277: URL: https://github.com/apache/spark/pull/49277#discussion_r1919131486
########## python/pyspark/sql/tests/pandas/test_pandas_transform_with_state.py: ########## @@ -1698,6 +1876,173 @@ def init(self, handle: StatefulProcessorHandle) -> None: self.list_state = handle.getListState("listState", key_schema) +class BasicProcessor(StatefulProcessor): + # Schema definitions + state_schema = StructType( + [StructField("id", IntegerType(), True), StructField("name", StringType(), True)] + ) + + def init(self, handle): + + self.state = handle.getValueState("state", self.state_schema) + + def handleInputRows(self, key, rows, timer_values) -> Iterator[pd.DataFrame]: + for pdf in rows: Review Comment: Done ########## sql/core/src/test/scala/org/apache/spark/sql/streaming/TransformWithListStateSuite.scala: ########## @@ -406,8 +439,12 @@ class TransformWithListStateSuite extends StreamTest testStream(result1, OutputMode.Update())( StartStream(checkpointLocation = dir.getCanonicalPath), - AddData(inputData, "a", "b"), - CheckNewAnswer(("a", "a"), ("b", "b")), + // Write data with initial schema + AddData(inputData, "item1", "item2"), + CheckAnswer(("item1", 1), ("item2", 1)), + // Add more items to verify count increment + AddData(inputData, "item1", "item3"), + CheckAnswer(("item1", 1), ("item2", 1), ("item1", 2), ("item3", 1)), Review Comment: Done -- 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. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org