类型 TableSchema.Builder 已弃用
The type TableSchema.Builder is deprecated
根据标题,类型TableSchema.Builder已弃用,VScode的建议是:This class has been deprecated as part of FLIP-164. It has been replaced by two more dedicated classes **Schema and ResolvedSchema**. Use Schema for declaration in APIs. ResolvedSchema is offered by the framework after resolution and validation.
我的问题:如何用两个更专用的 类 模式和 ResolvedSchema 替换 tableSchema?
对了,我在网上找了很久。但我找不到任何东西。需要一些想法如何实现这一点,提前致谢。
TableSchema.Builder tableBuilder = new TableSchema.Builder().fields(names, types);
primaryKey.ifPresent(
pk -> tableBuilder.primaryKey(
pk.getName(), pk.getColumns().toArray(new String[0])));
TableSchema tableSchema = tableBuilder.build();
这取决于您想要声明模式的内容:目录 table、连接器、DataStream API 转换?
以上所有位置都提供 Schema
参数。作为用户,你通常只需要使用Schema
。但是,Schema.Builder
提供了从来自框架的 ResolvedSchema
继承组件的方法。
根据标题,类型TableSchema.Builder已弃用,VScode的建议是:This class has been deprecated as part of FLIP-164. It has been replaced by two more dedicated classes **Schema and ResolvedSchema**. Use Schema for declaration in APIs. ResolvedSchema is offered by the framework after resolution and validation.
我的问题:如何用两个更专用的 类 模式和 ResolvedSchema 替换 tableSchema?
对了,我在网上找了很久。但我找不到任何东西。需要一些想法如何实现这一点,提前致谢。
TableSchema.Builder tableBuilder = new TableSchema.Builder().fields(names, types);
primaryKey.ifPresent(
pk -> tableBuilder.primaryKey(
pk.getName(), pk.getColumns().toArray(new String[0])));
TableSchema tableSchema = tableBuilder.build();
这取决于您想要声明模式的内容:目录 table、连接器、DataStream API 转换?
以上所有位置都提供 Schema
参数。作为用户,你通常只需要使用Schema
。但是,Schema.Builder
提供了从来自框架的 ResolvedSchema
继承组件的方法。