Interface KafkaRowConverter<K,V>

Type Parameters:
K - type for Kafka message key, refer to ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG;
V - type for Kafka message value, refer to ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG;
All Known Implementing Classes:
KafkaRowConverterImpl

public interface KafkaRowConverter<K,V>
Interface to handle formatting between Kafka message and Calcite row.
  • Method Summary

    Modifier and Type
    Method
    Description
    rowDataType(String topicName)
    Generates the row type for a given Kafka topic.
    toRow(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> message)
    Parses and reformats a Kafka message from the consumer, to align with row type defined as rowDataType(String).
  • Method Details

    • rowDataType

      RelDataType rowDataType(String topicName)
      Generates the row type for a given Kafka topic.
      Parameters:
      topicName - Kafka topic name
      Returns:
      row type
    • toRow

      Object[] toRow(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> message)
      Parses and reformats a Kafka message from the consumer, to align with row type defined as rowDataType(String).
      Parameters:
      message - Raw Kafka message record
      Returns:
      fields in the row