davidradl commented on code in PR #26396:
URL: https://github.com/apache/flink/pull/26396#discussion_r2027100263


##########
docs/content.zh/docs/dev/table/functions/ptfs.md:
##########
@@ -708,6 +708,80 @@ class CountingFunction extends 
ProcessTableFunction<String> {
 {{< /tab >}}
 {{< /tabs >}}
 
+### Large State
+
+Flink's state backends provide different types of state to efficiently handle 
large state.
+
+Currently, PTFs support three types of state:
+
+- **Value state**: Represents a single value.
+- **List state**: Represents a list of values, supporting operations like 
appending, removing, and iterating.
+- **Map state**: Represents a map (key-value pair) for efficient lookups, 
modifications, and removal of individual entries.
+
+By default, state entries in a PTF are represented as value state. This means 
that every state entry is fully read from
+the state backend when the evaluation method is called, and the value is 
written back to the state backend once the
+evaluation method finishes.
+
+To optimize state access and avoid unnecessary (de)serialization, state 
entries can be declared as:
+- `org.apache.flink.table.api.dataview.ListView` (for list state)
+- `org.apache.flink.table.api.dataview.MapView` (for map state)
+
+These provide direct views to the underlying Flink state backend.
+
+For example, when using a `MapView`, accessing a value via `MapView#get` will 
only deserialize the value associated with
+the specified key. This allows for efficient access to individual entries 
without needing to load the entire map. This
+approach is particularly useful when the map does not fit entirely into memory.
+
+{{< hint info >}}
+State TTL is applied individually to each entry in a list or map, allowing for 
fine-grained expiration control over state
+elements.
+{{< /hint >}}
+
+{{< tabs "1837eeed-3d13-455c-8e2f-5e164da9f844" >}}
+{{< tab "Java" >}}
+```java

Review Comment:
   I see this is example java code - but was hoping for a title or some 
preceding words to give some context, maybe explaining the value of the anomaly 
processing in the event history per user



-- 
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]

Reply via email to