bogao007 commented on code in PR #47933:
URL: https://github.com/apache/spark/pull/47933#discussion_r1775665288
##########
python/pyspark/sql/streaming/stateful_processor.py:
##########
@@ -50,19 +50,11 @@ def exists(self) -> bool:
"""
return self._value_state_client.exists(self._state_name)
- def get(self) -> Optional[Row]:
+ def get(self) -> Optional[Tuple]:
"""
Get the state value if it exists. Returns None if the state variable
does not have a value.
"""
- value = self._value_state_client.get(self._state_name)
- if value is None:
- return None
- schema = self.schema
- if isinstance(schema, str):
- schema = cast(StructType, _parse_datatype_string(schema))
- # Create the Row using the values and schema fields
- row = _create_row(schema.fieldNames(), value)
- return row
+ return self._value_state_client.get(self._state_name)
def update(self, new_value: Any) -> None:
Review Comment:
Sure, will address this in the next PR, thanks!
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]