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


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

Review Comment:
   I don't think so. At least the [core state TTL 
docs](https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/fault-tolerance/state/#state-time-to-live-ttl)
 don't mention that.



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