pub enum TextCast {
Direct(&'static str),
ClickHouseNullTolerant(&'static str),
}Expand description
How a dialect casts one call-site argument to text.
The hash is a hash of a string and a call-site argument is a raw column of its own declared type, so the cast is not optional.
Variants§
Direct(&'static str)
CAST(x AS <type>) — the cast propagates NULL, so Razeri’s NULL
sentinel is reached with the statement intact.
ClickHouseNullTolerant(&'static str)
assumeNotNull(CAST(x AS Nullable(<type>))) — ClickHouse, whose
CAST to a non-Nullable type raises instead of propagating
(“Cannot convert NULL to a non-nullable type”).
ClickHouse evaluates both arms of a CASE, so the sentinel cannot
save the statement: the emitted key expression failed outright on any
NULL natural-key part rather than returning the sentinel. That is not a
wrong key — it is a dimension load that does not run. The wrapper makes
the unreachable arm total; which value it would produce is irrelevant,
because the sentinel has already answered.