(
catalog: &dyn SessionCatalog,
format: &mut Option<FormatSpecifier<Aug>>,
options: &SourceFormatOptions,
envelope: &Option<SourceEnvelope>,
storage_configuration: &StorageConfigur
| 2264 | } |
| 2265 | |
| 2266 | async 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 | |
| 2296 | async fn purify_source_format_single( |
| 2297 | catalog: &dyn SessionCatalog, |
no test coverage detected