【发布时间】:2021-12-30 07:44:32
【问题描述】:
根据标题,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.
我的问题:如何用另外两个专用类 Schema 和 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();
【问题讨论】:
标签: java apache-flink