Repository navigation
Conversation
- Document that a parameter typed by TRY_CAST is decoded as the target type at bind time, and how to get NULL instead. - Soft-panic when TryCast would swallow an EvalError::Internal, so a planner bug stays visible in CI while production still yields NULL. - Reword the refused-cast error to say the cast exists and CAST supports it. - Enable enable_try_cast by default and mark TRY_CAST as added in v26.45. - Rewrite the docs' list of differences from CAST: catalog-lookup casts, constructors typed on their own, and the MAP constructor rejection as a consequence of that. - Pin that an infallible TRY_CAST stays unwrapped and NOT NULL, and stop using UnaryFunc::try_cast as the coverage test's own oracle. - After rebasing onto the "char" cast fix, thread the failure mode through its cast lookup, regenerate the "char" matrix rows, and lift the property test's "char" exclusion. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Keep the type hint for empty ARRAY, LIST, and MAP constructors under TRY_CAST, which have no element casts to protect. Only a non-empty MAP constructor is still rejected. - Make TryCast's inner function private, with UnaryFunc::try_cast_if_fallible as the only constructor, so a wrapper always holds a fallible function and is always nullable. - Use the parser's CastFailureMode throughout and drop the mz_expr copy. - Document the chain shape a cast template needs for TRY_CAST. - Pin how TRY_CAST plans with EXPLAIN over columns: a single fallible stage, an infallible cast, multi-stage chains, and the optimized plan. - Move the adapter's TRY_CAST tests into catalog/try_cast_tests.rs. - Put the refused-cast remedy in a hint, and log a swallowed internal error in production instead of staying silent. - Mark TRY_CAST as added in v26.46, and drop SqlScalarType::contains, whose only caller was the "char" exclusion the property test no longer needs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ggevay
approved these changes
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds some tiny tweaks that were accidentally left out of #38845.