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

Function purify_source_format

src/sql/src/pure.rs:2266–2294  ·  view source on GitHub ↗
(
    catalog: &dyn SessionCatalog,
    format: &mut Option<FormatSpecifier<Aug>>,
    options: &SourceFormatOptions,
    envelope: &Option<SourceEnvelope>,
    storage_configuration: &StorageConfigur

Source from the content-addressed store, hash-verified

2264}
2265
2266async fn purify_source_format(
2267 catalog: &dyn SessionCatalog,
2268 format: &mut Option<FormatSpecifier<Aug>>,
2269 options: &SourceFormatOptions,
2270 envelope: &Option<SourceEnvelope>,
2271 storage_configuration: &StorageConfiguration,
2272) -> Result<(), PlanError> {
2273 if matches!(format, Some(FormatSpecifier::KeyValue { .. }))
2274 && !matches!(options, SourceFormatOptions::Kafka { .. })
2275 {
2276 sql_bail!("Kafka sources are the only source type that can provide KEY/VALUE formats")
2277 }
2278
2279 match format.as_mut() {
2280 None => {}
2281 Some(FormatSpecifier::Bare(format)) => {
2282 purify_source_format_single(catalog, format, options, envelope, storage_configuration)
2283 .await?;
2284 }
2285
2286 Some(FormatSpecifier::KeyValue { key, value: val }) => {
2287 purify_source_format_single(catalog, key, options, envelope, storage_configuration)
2288 .await?;
2289 purify_source_format_single(catalog, val, options, envelope, storage_configuration)
2290 .await?;
2291 }
2292 }
2293 Ok(())
2294}
2295
2296async fn purify_source_format_single(
2297 catalog: &dyn SessionCatalog,

Callers 2

purify_create_sourceFunction · 0.85

Calls 2

as_mutMethod · 0.45

Tested by

no test coverage detected