1.Build System
flink支持使用java17进行项目编译,但是目前处于beta测试中;
2.Table API & SQL
列宽度进行了限制,新增了参数进行控制:
API中设置:DISPLAY_MAX_COLUMN_WIDTH
(table.display.max-column-width
)
SQL中设置:SET 'table.display.max-column-width' = '40';
弃用了sql-client.display.max-column-width配置
3.Introduce Flink JDBC Driver For SQL Gateway
flink支持sqlgateway方式进行接口查询,引用官方样例:
启动:
./bin/sql-gateway.sh start -Dsql-gateway.endpoint.rest.address=localhost
查询:
$ curl --request POST http://localhost:8083/v1/sessions/${sessionHandle}/statements/ --data '{"statement": "SELECT 1"}'
{"operationHandle":"..."}
4.Extend watermark-related features for SQL
flinksql水印相关特性支持;
flinksql提供了参数支持支设置水印的生成策略、空闲资源设置、水印的对齐方式;
4.1水印生成策略:
'scan.watermark.emit.strategy'='on-event'
4.2空闲资源设置:
'scan.watermark.idle-timeout'='1min'
4.3水印的对齐方式:
'scan.watermark.alignment.group'='alignment-group-1',
'scan.watermark.alignment.max-drift'='1min',
'scan.watermark.alignment.update-interval'='1s',
5.Support configuring CatalogStore in Table API
tabel Api中支持配置Catalog Store。
1.18对用户开放了可自主配置catelog存储位置的功能
5.1 目前catelog strore支持三种方式的配置:
GenericInMemoryCatalogStore :基于内存实现的 Catalog Store,所有的 Catalog 配置只在 session 的生命周期内可用, session 重建之后 store 中保存的 Catalog 配置也会自动清理:
kind | 指定要使用的 Catalog Store 类型,此处应为 'generic_in_memory' |
FileCatalogStore :以将用户的 Catalog 配置信息保存至文件中,使用 FileCatalogStore 需要指定 Catalog 配置需要 保存的目录,不同的 Catalog 会对应不同的文件并和 Catalog Name 一一对应。
kind | 指定要使用的 Catalog Store 类型,此处应为 'file' |
path | 指定要使用的 Catalog Store 保存的路径,必须是一个合法的目录,当前只支持本地目录 |
用户自定义 Catalog Store
5.2 catelog store的配置
Table API配置:
// Initialize a catalog Store
CatalogStore catalogStore = new FileCatalogStore("file://path/to/catalog/store/");
// set up the catalog store
final EnvironmentSettings settings =
EnvironmentSettings.newInstance().inBatchMode()
.withCatalogStore(catalogStore)
.build();
final TableEnvironment tableEnv = TableEnvironment.create(settings);
或者
// set up configuration
Configuration configuration = new Configuration();
configuration.set("table.catalog-store.kind", "file");
configuration.set("table.catalog-store.file.path", "file://path/to/catalog/store/");
// set up the configuration.
final EnvironmentSettings settings =
EnvironmentSettings.newInstance().inBatchMode()
.withConfiguration(configuration)
.build();
final TableEnvironment tableEnv = TableEnvironment.create(settings);
YAML 配置:
table.catalog-store.kind: file
table.catalog-store.file.path: /path/to/catalog/store/
6.Deprecate ManagedTable related APIs
以下类和方法被弃用,可能会在之后的版本中移除
Class / Method | Annotation |
---|---|
org.apache.flink.table.catalog.Catalog#supportsManagedTable | PublicEvolving |
org.apache.flink.table.factories.ManagedTableFactory | Internal |
org.apache.flink.table.catalog.ManagedTableListener | |
org.apache.flink.table.catalog.CatalogLock | |
org.apache.flink.table.connector.RequireCatalogLock | |
org.apache.flink.table.catalog.CatalogLock.Factory | N.A. |
7.JSON format supports projection push down
新增一反序列化json方式:JsonParser
8.Unifying the Implementation of SlotManage
统一了slot的资源使用方式。
Tip:目前有比较多的局限性,比如不支持弹性伸缩等;
9.Replace Akka by Pekko
filnk RPC框架由Akka换成了Pekko
10.Introduce Runtime Filter for Flink Batch Jobs
为Flink批处理作业引入运行时过滤器:主要是运行是生成过滤器,减少shull数据量,减少IO。
11.Make watermark alignment ready for production use
解了一个watermark对齐的bug: FLINK-32420
12.Properly deprecate DataSet API
DataSet API之后会被弃用
13.RestClient can deadlock if request made after Netty event executor terminated
final ChannelFuture connectFuture = bootstrap.connect(targetAddress, targetPort);
final CompletableFuture<Channel> channelFuture = new CompletableFuture<>();
connectFuture.addListener(
(ChannelFuture future) -> {
if (future.isSuccess()) {
channelFuture.complete(future.channel());
} else {
channelFuture.completeExceptionally(future.cause());
}
});
解了一个RestClient死锁的bug,这段代码里面,如果执行到channelFuture.complete()的时候,executor挂掉,那么等待complete的代码都将等待而造成死锁。
14.Upgrade Calcite version to 1.32.0
flinksql的解析器器calcite版本升级。