snuyanzin commented on code in PR #817:
URL: https://github.com/apache/flink-web/pull/817#discussion_r2576367970
##########
docs/content/posts/2025-11-30-release-2.2.0.md:
##########
@@ -0,0 +1,312 @@
+---
+title: "Apache Flink 2.2.0: Advancing Real-Time Data + AI and Empowering
Stream Processing for the AI Era"
+date: "2025-11-30T00:00:00.000Z"
+aliases:
+- /news/2025/11/30/release-2.2.0.html
+authors:
+- Hang:
+ name: "Hang Ruan"
+
+---
+
+The Apache Flink PMC is proud to announce the release of Apache Flink 2.2.0.
Flink 2.2.0 further enriches AI capabilities, enhances materialized tables and
the Connector framework, and improves batch processing and PyFlink support.
This release brings together 73 global contributors, implements 9 FLIPs (Flink
Improvement Proposals), and resolves over 220 issues. We extend our gratitude
to all contributors for their invaluable support!
+
+Let's dive into the highlights.
+
+# Flink SQL Improvements
+
+## Realtime AI Function
+Apache Flink has supported leveraging LLM capabilities through the
`ML_PREDICT` function in Flink SQL
+since version 2.1, enabling users to perform semantic analysis in a simple and
efficient way. In Flink
+ 2.2, the Table API also supports model inference operations that allow you to
integrate machine learning
+models directly into your data processing pipelines. You can create models
with specific providers (like
+ OpenAI) and use them to make predictions on your data.
+
+Example:
+- Creating and Using Models
+```java
+// 1. Set up the local environment
+EnvironmentSettings settings = EnvironmentSettings.inStreamingMode();
+TableEnvironment tEnv = TableEnvironment.create(settings);
+
+// 2. Create a source table from in-memory data
+Table myTable = tEnv.fromValues(
+ ROW(FIELD("text", STRING())),
+ row("Hello"),
+ row("Machine Learning"),
+ row("Good morning")
+);
+
+// 3. Create model
+tEnv.createModel(
+ "my_model",
+ ModelDescriptor.forProvider("openai")
+ .inputSchema(Schema.newBuilder().column("input", STRING()).build())
+ .outputSchema(Schema.newBuilder().column("output", STRING()).build())
+ .option("endpoint", "https://api.openai.com/v1/chat/completions")
+ .option("model", "gpt-4.1")
+ .option("system-prompt", "translate to chinese")
+ .option("api-key", "<your-openai-api-key-here>")
+ .build()
+);
+
+Model model = tEnv.fromModel("my_model");
+
+// 4. Use the model to make predictions
+Table predictResult = model.predict(myTable, ColumnList.of("text"));
+
+// 5. Async prediction example
+Table asyncPredictResult = model.predict(
+ myTable,
+ ColumnList.of("text"),
+ Map.of("async", "true")
+);
+```
+
+**More Information**
+* [FLINK-38104](https://issues.apache.org/jira/browse/FLINK-38104)
+*
[FLIP-526](https://cwiki.apache.org/confluence/display/FLINK/FLIP-526%3A+Model+ML_PREDICT%2C+ML_EVALUATE+Table+API)
+
+## Vector Search
+
+Apache Flink has supported leveraging LLM capabilities through the
`ML_PREDICT` function in Flink SQL
+since version 2.1. This integration has been technically validated in
scenarios such as log classification
+and real-time question-answering systems. However, the current architecture
allows Flink to only use
+embedding models to convert unstructured data (e.g., text, images) into
high-dimensional vector features,
+which are then persisted to downstream storage systems. It lacks real-time
online querying and similarity
+analysis capabilities for vector spaces. The VECTOR_SEARCH function is
provided in Flink 2.2 to enable users
+to perform streaming vector similarity searches and real-time context
retrieval
+directly within Flink.
+
+Take the following SQL statements as an example:
+```sql
+-- Basic usage
+SELECT * FROM
+input_table, LATERAL TABLE(VECTOR_SEARCH(
+ TABLE vector_table,
+ input_table.vector_column,
+ DESCRIPTOR(index_column),
+ 10
+));
+
+-- With configuration options
+SELECT * FROM
+input_table, LATERAL TABLE(VECTOR_SEARCH(
+ TABLE vector_table,
+ input_table.vector_column,
+ DESCRIPTOR(index_column),
+ 10,
+ MAP['async', 'true', 'timeout', '100s']
+));
Review Comment:
```suggestion
input_table, LATERAL VECTOR_SEARCH(
TABLE vector_table,
input_table.vector_column,
DESCRIPTOR(index_column),
10,
MAP['async', 'true', 'timeout', '100s']
);
```
--
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]