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

Method detail

src/sql/src/plan/error.rs:335–401  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

333 }
334
335 pub fn detail(&self) -> Option<String> {
336 match self {
337 Self::NeverSupported { details, .. } => details.clone(),
338 Self::FetchingCsrSchemaFailed { cause, .. } => Some(cause.to_string_with_causes()),
339 Self::PostgresConnectionErr { cause } => Some(cause.to_string_with_causes()),
340 Self::InvalidProtobufSchema { cause } => Some(cause.to_string_with_causes()),
341 Self::InvalidOptionValue { err, .. } => err.detail(),
342 Self::UpsertSinkWithInvalidKey {
343 name,
344 desired_key,
345 valid_keys,
346 } => {
347 let valid_keys = if valid_keys.is_empty() {
348 "There are no known valid unique keys for the underlying relation.".into()
349 } else {
350 format!(
351 "The following keys are known to be unique for the underlying relation:\n{}",
352 valid_keys
353 .iter()
354 .map(|k|
355 format!(" ({})", k.iter().map(|c| c.as_str().quoted()).join(", "))
356 )
357 .join("\n"),
358 )
359 };
360 Some(format!(
361 "Materialize could not prove that the specified upsert envelope key ({}) \
362 was a unique key of the underlying relation {}. {valid_keys}",
363 separated(", ", desired_key.iter().map(|c| c.as_str().quoted())),
364 name.quoted()
365 ))
366 }
367 Self::VarError(e) => e.detail(),
368 Self::InternalFunctionCall => Some("This function is for the internal use of the database system and cannot be called directly.".into()),
369 Self::PgSourcePurification(e) => e.detail(),
370 Self::MySqlSourcePurification(e) => e.detail(),
371 Self::SqlServerSourcePurificationError(e) => e.detail(),
372 Self::KafkaSourcePurification(e) => e.detail(),
373 Self::LoadGeneratorSourcePurification(e) => e.detail(),
374 Self::CsrPurification(e) => e.detail(),
375 Self::GluePurification(e) => e.detail(),
376 Self::KafkaSinkPurification(e) => e.detail(),
377 Self::IcebergSinkPurification(e) => e.detail(),
378 Self::SubsourceNameConflict {
379 name: _,
380 upstream_references,
381 } => Some(format!(
382 "referenced tables with duplicate name: {}",
383 itertools::join(upstream_references, ", ")
384 )),
385 Self::SubsourceDuplicateReference {
386 name: _,
387 target_names,
388 } => Some(format!(
389 "subsources referencing table: {}",
390 itertools::join(target_names, ", ")
391 )),
392 Self::InvalidPartitionByEnvelopeDebezium { .. } => Some(

Callers

nothing calls this directly

Calls 4

to_string_with_causesMethod · 0.80
cloneMethod · 0.45
is_emptyMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected