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

Function humanize_or_debug

src/sql/src/plan/query.rs:5199–5203  ·  view source on GitHub ↗

Returns a human-readable rendering of `name`, falling back to a debug dump of the `ResolvedItemName` if humanization fails. Used to construct user-facing error messages on already-failing paths, where we'd rather surface the raw resolved name than emit a useless ` ` placeholder.

(scx: &StatementContext, name: &ResolvedItemName)

Source from the content-addressed store, hash-verified

5197/// user-facing error messages on already-failing paths, where we'd rather
5198/// surface the raw resolved name than emit a useless `<unknown>` placeholder.
5199fn humanize_or_debug(scx: &StatementContext, name: &ResolvedItemName) -> String {
5200 scx.humanize_resolved_name(name)
5201 .map(|n| n.to_string())
5202 .unwrap_or_else(|_| format!("<error when trying to humanize `{name:?}`>"))
5203}
5204
5205/// Common part of the planning of windowed and non-windowed aggregation functions.
5206fn plan_aggregate_common(

Callers

nothing calls this directly

Calls 3

mapMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected