Skip to main content

parse_kafka_source_details

Function parse_kafka_source_details 

Source
fn parse_kafka_source_details<'a>(a: &'a str) -> Result<Jsonb, EvalError>
Expand description

Extracts kafka source configuration (topic, group id prefix, connection id) from a catalog create_sql. Returns:

  • jsonb {"topic": <text>, "group_id_prefix": <text | null>, "connection_id": <text>} for CREATE SOURCE ... FROM KAFKA CONNECTION ... (TOPIC = ..., [GROUP ID PREFIX = ...]) statements.
  • jsonb null for any other statement.

Errors if the statement fails to parse, is a kafka source without a TOPIC option, or references an unresolved connection name (i.e. one that hasn’t been through purification).