morrySnow opened a new pull request, #68367:
URL: https://github.com/apache/doris/pull/68367
### What problem does this PR solve?
Issue Number: N/A
Related PR: None
Problem Summary: `Cast.castNullable` describes the outer result column's
nullability, but does not tell an optimizer whether converting a non-null value
can fail. For example, `ARRAY<STRING> -> ARRAY<INT>` can leave the outer array
non-null while an element conversion fails. This PR adds
`Cast.mayFailOnNonNullInput` as a reusable type-pair and expression-level
analysis. It recurses through ARRAY, MAP, and STRUCT, recognizes BE conversions
proven not to report data-dependent failures, and conservatively treats other
conversions as possibly failing. A strict CAST can report such a failure as an
error, while a non-strict CAST or TRY_CAST may produce NULL. The new API has no
production callers yet.
### Release note
None
### Check List (For Author)
- Test
- [x] Unit Test: `./run-fe-ut.sh --run
org.apache.doris.nereids.trees.expressions.CastTest` (23 passed)
- [x] FE build and Checkstyle:
`MVN_OPT=-Dmaven.build.cache.enabled=false FE_MAVEN_THREADS=4
DISABLE_BUILD_UI=ON ./build.sh --fe --exclude-obs-dependencies --output
/private/tmp/doris-cast-conversion-build`
- Behavior changed:
- [x] No. This adds analysis infrastructure without changing planner
decisions or execution.
- Does this need documentation?
- [x] No.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]