Flink 1.18VS1.17 功能演进

本文介绍了Flink的最新进展,包括使用Java17编译、TableAPI列宽控制、SQLGateway的集成、水印功能增强、CatalogStore配置、旧API的弃用、JSON解析支持和性能优化,如计算图管理及版本升级。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

        参考:Catalogs | Apache Flink

        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

        以下类和方法被弃用,可能会在之后的版本中移除

Public Interfaces

Class / MethodAnnotation
org.apache.flink.table.catalog.Catalog#supportsManagedTablePublicEvolving
org.apache.flink.table.factories.ManagedTableFactoryInternal
org.apache.flink.table.catalog.ManagedTableListener
org.apache.flink.table.catalog.CatalogLock
org.apache.flink.table.connector.RequireCatalogLock
org.apache.flink.table.catalog.CatalogLock.FactoryN.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版本升级。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值