flinksql编写的时候遇到
Caused by: org.apache.flink.table.api.ValidationException: Could not find any factory for identifier 'json' that implements 'org.apache.flink.table.factories.DeserializationFormatFactory' in the classpath.
Available factory identifiers are:
raw
at org.apache.flink.table.factories.FactoryUtil.discoverFactory(FactoryUtil.java:235)
at org.apache.flink.table.factories.FactoryUtil$TableFactoryHelper.discoverOptionalFormatFactory(FactoryUtil.java:588)
at org.apache.flink.table.factories.FactoryUtil$TableFactoryHelper.discoverOptionalDecodingFormat(FactoryUtil.java:486)
at org.apache.flink.streaming.connectors.kafka.table.KafkaDynamicTableFactory.getValueDecodingFormat(KafkaDynamicTableFactory.java:272)
at org.apache.flink.streaming.connectors.kafka.table.KafkaDynamicTableFactory.createDynamicTableSource(KafkaDynamicTableFactory.java:141)
at org.apache.flink.table.factories.FactoryUtil.createTableSource(FactoryUtil.java:119)
... 19 more
如果遇到相关的
ValidationException: Could not find any factory for identifier 'json' that implements 'org.apache.flink.table.factories.DeserializationFormatFactory' in the classpath.
1、看类DeserializationFormatFactory 的源码
package org.apache.flink.table.factories;
import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.api.common.serialization.DeserializationSchema;
import org.apache.flink.table.connector.format.DecodingFormat;
import org.apache.flink.table.data.RowData;
/**
* Factory for creating a {@link DecodingFormat} for {@link DeserializationSchema}.
*
* @see FactoryUtil#createTableFactoryHelper(DynamicTableFactory, DynamicTableFactory.Context)
*/
@PublicEvolving
public interface DeserializationFormatFactory
extends DecodingFormatFactory<DeserializationSchema<RowData>> {
// interface is used for discovery but is already fully specified by the generics
}
2、找到下面实现的类,发现确实没有json相关
?
?
3、去官网??https://ci.apache.org/projects/flink/flink-docs-release-1.12/zh/dev/table/connectors/formats/? 找到相应的格式并导入相关的依赖
?4、可以看到需要的实现出现了,问了解决
?
|