Hi all, I need help on using the Table API: After ...
# troubleshooting
e
Hi all, I need help on using the Table API: After adding the following dependencies:
Copy code
implementation("org.apache.flink:flink-table-api-java:$flinkVersion")
    compileOnly("org.apache.flink:flink-table-api-java-bridge:$flinkVersion")
    compileOnly("org.apache.flink:flink-sql-connector-kafka:3.1.0-1.18")
    implementation("org.apache.kafka:kafka-clients:3.6.1")
I another part of the code that wasn’t modified
Copy code
private class TopicAwareDeserializer(val messageSchema: MessageSchema<*>) : KafkaRecordDeserializationSchema<TopicAwareRecord> {
    override fun deserialize(
        record: ConsumerRecord<ByteArray, ByteArray>?,
        collector: Collector<TopicAwareRecord>?,
    ) {
        record?.let {
            val value = messageSchema.deserialize(record.value())
            val topicAware =
                TopicAwareRecord(
                    record.topic(),
                    value,
                )
            collector?.collect(topicAware)
        }
    }

    override fun getProducedType(): TypeInformation<TopicAwareRecord> {
        return TypeInformation.of(TopicAwareRecord::class.java)
    }
}
Started showing the following error when trying to build:
Copy code
Class 'TopicAwareDeserializer' is not abstract and does not implement abstract member public abstract fun deserialize(p0: ConsumerRecord<ByteArray!, ByteArray!>!, p1: Collector<TopicAwareRecord!>!): Unit defined in org.apache.flink.connector.kafka.source.reader.deserializer.KafkaRecordDeserializationSchema
'deserialize' overrides nothing
m
Well version 3.6.1 of the Kafka Clients is definitely not supported
e
I am having the same error with version 3.7.0
m
Both are too new
e
Thanks let me try that
Now it builds successfully but a new error came up while submitting the job to the cluster
Copy code
Caused by: org.apache.kafka.common.KafkaException: class org.apache.flink.kafka.shaded.org.apache.kafka.common.serialization.ByteArrayDeserializer is not an instance of org.apache.kafka.common.serialization.Deserializer
	at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstance(AbstractConfig.java:405)
	at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstance(AbstractConfig.java:436)
	at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstance(AbstractConfig.java:421)
	at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:709)