This is Technical Insights Series by Perry Ma | Product Lead, Real-time Compute for Apache Flink at Alibaba Cloud.
Table API, as Flink's declarative API, makes data processing more intuitive and simple. FLIP-11's goal is to enable Table API to handle stream aggregation operations elegantly.
Imagine this scenario: an e-commerce platform needs to track sales statistics for each product in real-time. This requirement seems simple but involves several key challenges:
Before FLIP-11, Table API only supported basic operations like projection, selection, and union. To implement the above statistics functionality, developers often needed to write complex code directly using DataStream API.
Let's visually compare the differences before and after the improvement:


FLIP-11 introduced two main aggregation mechanisms:
This mechanism is mainly used for scenarios requiring grouping by time or row count. For example, "calculate product sales every 5 minutes."
Supports three window types:

This mechanism is better suited for scenarios like "calculate based on current row's surrounding range." For example, "calculate the difference between each order amount and the average of the previous 10 orders."
Let's look at some practical examples:
// Example 1: Calculate product sales every 10 minutes
val result = tableEnv.from("sales")
.window(Tumble over 10.minutes on 'rowtime as 'w)
.groupBy('productId, 'w)
.select('productId, 'price.sum)
// Example 2: Calculate price difference between each order and previous 5 orders
val result = tableEnv.from("orders")
.rowWindow(SlideRows preceding 5.rows following 0.rows as 'w)
.select('orderId,
'price,
'price.avg over 'w as 'avgPrice)
Implementation involves several key points:

Choose Appropriate Window Type:
Time Window Considerations:
State Cleanup:
FLIP-11's implementation makes Flink's Table API more powerful and user-friendly for handling stream aggregation. It not only provides rich aggregation functionality but also achieves a good balance between performance and usability.
This feature was released in Flink 1.4.0 and has been further optimized in subsequent versions. If your project involves stream data aggregation processing, Table API would be an excellent choice.
Apache Flink FLIP-10: Complete Guide to Unified Checkpoints and Savepoints
206 posts | 54 followers
FollowApache Flink Community - April 10, 2025
Alibaba Cloud Community - September 3, 2024
Apache Flink Community - May 9, 2025
Apache Flink Community China - August 22, 2023
Data Geek - May 9, 2023
Apache Flink Community China - August 2, 2019
206 posts | 54 followers
Follow
Realtime Compute for Apache Flink
Realtime Compute for Apache Flink offers a highly integrated platform for real-time data processing, which optimizes the computing of Apache Flink.
Learn More
Message Queue for Apache Kafka
A fully-managed Apache Kafka service to help you quickly build data pipelines for your big data analytics.
Learn More
Real-Time Livestreaming Solutions
Stream sports and events on the Internet smoothly to worldwide audiences concurrently
Learn More
OpenAPI Explorer
OpenAPI Explorer allows you to call an API through its web interface or WebCLI, and view the entire process.
Learn MoreMore Posts by Apache Flink Community