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

Class ExplainOption

misc/python/materialize/mzexplore/common.py:61–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59
60@dataclass(frozen=True)
61class ExplainOption:
62 key: str
63 val: str | bool | int | None = None
64
65 def __str__(self):
66 key = self.key.replace("_", " ").upper()
67 if self.val is None:
68 return f"{key}"
69 else:
70 return f"{key} = {literal(self.val)}" # type: ignore
71
72 def affects_pipeline(self) -> bool:
73 """
74 Returns true iff the `EXPLAIN` feature flag might affect the output of
75 the optimizer pipeline.
76 """
77 return any(
78 (
79 self.key.lower() == "reoptimize_imported_views",
80 self.key.lower().startswith("enable_"),
81 )
82 )
83
84
85class ExplainOptionType(click.ParamType):

Callers 2

plansFunction · 0.90
convertMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected