MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parse_kafka_source_config_option

Method parse_kafka_source_config_option

src/sql-parser/src/parser.rs:2805–2832  ·  view source on GitHub ↗
(
        &mut self,
    )

Source from the content-addressed store, hash-verified

2803 }
2804
2805 fn parse_kafka_source_config_option(
2806 &mut self,
2807 ) -> Result<KafkaSourceConfigOption<Raw>, ParserError> {
2808 let name = match self.expect_one_of_keywords(&[GROUP, START, TOPIC])? {
2809 GROUP => {
2810 self.expect_keywords(&[ID, PREFIX])?;
2811 KafkaSourceConfigOptionName::GroupIdPrefix
2812 }
2813 START => match self.expect_one_of_keywords(&[OFFSET, TIMESTAMP])? {
2814 OFFSET => KafkaSourceConfigOptionName::StartOffset,
2815 TIMESTAMP => KafkaSourceConfigOptionName::StartTimestamp,
2816 _ => unreachable!(),
2817 },
2818 TOPIC => {
2819 if self.parse_keyword(METADATA) {
2820 self.expect_keywords(&[REFRESH, INTERVAL])?;
2821 KafkaSourceConfigOptionName::TopicMetadataRefreshInterval
2822 } else {
2823 KafkaSourceConfigOptionName::Topic
2824 }
2825 }
2826 _ => unreachable!(),
2827 };
2828 Ok(KafkaSourceConfigOption {
2829 name,
2830 value: self.parse_optional_option_value()?,
2831 })
2832 }
2833
2834 fn parse_iceberg_sink_config_option(
2835 &mut self,

Callers

nothing calls this directly

Calls 4

expect_keywordsMethod · 0.80
parse_keywordMethod · 0.80

Tested by

no test coverage detected