Oscar Perez
05/29/2023, 5:01 PMCREATE TEMPORARY TABLE users_tnc
(
userId STRING,
country STRING,
acceptedTime TIMESTAMP(3),
eventMetadata row(eventId STRING, eventTime TIMESTAMP(3)),
PRIMARY KEY (userId) NOT ENFORCED
) WITH (
'connector' = 'kafka',
'topic' = 'usertnc.v1beta1',
'properties.bootstrap.servers' = 'localhost:9094',
'properties.group.id' = 'ethanol-bmp',
'key.format' = 'raw',
'value.format' = 'raw',
'format' = 'protobuf',
'protobuf.message-class-name' = 'com.test.UserTnCChangedEvent',
'protobuf.ignore-parse-errors' = 'true'
);
we are facing with the following exception:
Caused by: org.apache.flink.table.api.ValidationException: Could not find any factory for identifier 'protobuf' that implements 'org.apache.flink.table.factories.DeserializationFormatFactory' in the classpath.
We are using flink 1.16 and made sure that the flink protobuf library is in the classpath (packaged as part of the uber jar)
thanks!Sharon Xie
05/29/2023, 8:44 PMflink-protobuf
in your dependency? See https://nightlies.apache.org/flink/flink-docs-release-1.16/docs/connectors/table/formats/protobuf/
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-protobuf</artifactId>
<version>1.16.1</version>
</dependency>
Oscar Perez
05/30/2023, 7:19 AMSharon Xie
05/30/2023, 9:57 PMHangyu Wang
06/02/2023, 8:52 AMOscar Perez
06/02/2023, 9:12 AMHangyu Wang
06/02/2023, 9:40 AMflink-protobuf
to flink/lib?Hangyu Wang
06/02/2023, 9:53 AMCaused by: java.lang.ClassCastException: class com.google.protobuf.Descriptors$Descriptor cannot be cast to class com.google.protobuf.Descriptors$Descriptor (com.google.protobuf.Descriptors$Descriptor is in unnamed module of loader org.apache.flink.util.ChildFirstClassLoader @3fc9504b; com.google.protobuf.Descriptors$Descriptor is in unnamed module of loader 'app')
Sharon Xie
06/04/2023, 8:56 PMX cannot be cast to X exceptions
, and put the uber jar directly in the flink/lib. See https://nightlies.apache.org/flink/flink-docs-release-1.16/docs/ops/debugging/debugging_classloading/#avoiding-dynamic-classloading-for-user-codeHangyu Wang
06/05/2023, 2:41 AMCaused by: org.apache.flink.formats.protobuf.PbCodegenException: java.lang.IllegalArgumentException: get javaProto.autox.metric_event.MetricEventTest descriptors error!
at org.apache.flink.formats.protobuf.deserialize.ProtoToRowConverter.<init>(ProtoToRowConverter.java:124)
at org.apache.flink.formats.protobuf.deserialize.PbRowDataDeserializationSchema.open(PbRowDataDeserializationSchema.java:64)
at org.apache.flink.connector.file.table.DeserializationSchemaAdapter.createDeserialization(DeserializationSchemaAdapter.java:64)
... 17 more
Caused by: java.lang.IllegalArgumentException: get javaProto.autox.metric_event.MetricEventTest descriptors error!
at org.apache.flink.formats.protobuf.util.PbFormatUtils.getDescriptor(PbFormatUtils.java:126)
at org.apache.flink.formats.protobuf.deserialize.ProtoToRowConverter.<init>(ProtoToRowConverter.java:62)
... 19 more
Caused by: java.lang.ClassCastException: class com.google.protobuf.Descriptors$Descriptor cannot be cast to class com.google.protobuf.Descriptors$Descriptor (com.google.protobuf.Descriptors$Descriptor is in unnamed module of loader org.apache.flink.util.ChildFirstClassLoader @7604fe85; com.google.protobuf.Descriptors$Descriptor is in unnamed module of loader 'app')
at org.apache.flink.formats.protobuf.util.PbFormatUtils.getDescriptor(PbFormatUtils.java:123)
... 20 more
~/ $ ~/Downloads/flink-1.17.0/bin/flink run target/import-1.0-SNAPSHOT.jar --input_file test.txt
Job has been submitted with JobID bdbbcc8342f7bdc8a017bc325f83ab81
Empty set