Package org.apache.calcite.adapter.kafka
Class KafkaRowConverterImpl
java.lang.Object
org.apache.calcite.adapter.kafka.KafkaRowConverterImpl
- All Implemented Interfaces:
KafkaRowConverter<byte[],
byte[]>
Default implementation of
KafkaRowConverter
, both key and value are byte[].-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionrowDataType
(String topicName) Generates the row schema for a given Kafka topic.Object[]
toRow
(org.apache.kafka.clients.consumer.ConsumerRecord<byte[], byte[]> message) Parses and reformats a Kafka message from the consumer, to align with the row schema defined asrowDataType(String)
.
-
Constructor Details
-
KafkaRowConverterImpl
public KafkaRowConverterImpl()
-
-
Method Details
-
rowDataType
Generates the row schema for a given Kafka topic.- Specified by:
rowDataType
in interfaceKafkaRowConverter<byte[],
byte[]> - Parameters:
topicName
- Kafka topic name- Returns:
- row type
-
toRow
Parses and reformats a Kafka message from the consumer, to align with the row schema defined asrowDataType(String)
.- Specified by:
toRow
in interfaceKafkaRowConverter<byte[],
byte[]> - Parameters:
message
- Raw Kafka message record- Returns:
- fields in the row
-