Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
statefun-2.0.0
Description
The PersistedAppendingBuffer state primitive in Stateful Functions, states that view() returns null if the buffer wasn't accessed before, or after a clear().
This actually is not possible. The PersistedAppendingBuffer primitive is based on Flink's ListState state handle, which always returns an empty list if the elements of the list is empty, and never a null.
This means that the PersistedAppendingBuffer won't be able to differentiate the cases (e.g. if the state wasn't accessed or cleared v.s. an empty buffer).
We suggest to just change the contract so that PersistedAppendingBuffer#view() follows the behavior of Flink's ListState to never return null.
Attachments
Issue Links
- links to