Class KafkaRowConverterImpl

java.lang.Object
org.apache.calcite.adapter.kafka.KafkaRowConverterImpl
All Implemented Interfaces:
KafkaRowConverter<byte[],byte[]>

public class KafkaRowConverterImpl extends Object implements KafkaRowConverter<byte[],byte[]>
Default implementation of KafkaRowConverter, both key and value are byte[].
  • Constructor Details

    • KafkaRowConverterImpl

      public KafkaRowConverterImpl()
  • Method Details

    • rowDataType

      public RelDataType rowDataType(String topicName)
      Generates the row schema for a given Kafka topic.
      Specified by:
      rowDataType in interface KafkaRowConverter<byte[],byte[]>
      Parameters:
      topicName - Kafka topic name
      Returns:
      row type
    • toRow

      public 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 as rowDataType(String).
      Specified by:
      toRow in interface KafkaRowConverter<byte[],byte[]>
      Parameters:
      message - Raw Kafka message record
      Returns:
      fields in the row