Jamison929611 opened a new pull request, #24282:
URL: https://github.com/apache/datafusion/pull/24282

   ## Which issue does this PR close?
   
   - Closes #24135.
   
   ## Rationale for this change
   
   When a coercion's desired type is a native logical type, callers currently 
have to repeat that type as both `TypeSignatureClass::Native(...)` and 
`default_casted_type`. This duplication is confusing and can allow the two 
values to disagree.
   
   ## What changes are included in this PR?
   
   - Add `Coercion::new_implicit_native`, which derives `default_casted_type` 
from the desired logical type and delegates to the existing `new_implicit` 
constructor.
   - Keep `Coercion::new_implicit` unchanged for backward compatibility and 
non-native desired type classes.
   - Migrate the representative `reverse` and `approx_percentile_cont` call 
sites linked from the issue.
   - Update the `Coercion` rustdoc example and add a constructor-equivalence 
unit test.
   
   ## Are these changes tested?
   
   Yes:
   
   - `cargo test -p datafusion-expr-common test_new_implicit_native --lib`
   - `cargo test -p datafusion-functions reverse --lib`
   - `cargo test -p datafusion-functions-aggregate approx_percentile_cont --lib`
   - `cargo test -p datafusion-expr-common --doc`
   - `cargo clippy -p datafusion-expr-common -p datafusion-functions -p 
datafusion-functions-aggregate --all-targets --all-features -- -D warnings`
   - `cargo fmt --all`
   
   The required full-workspace `cargo clippy --all-targets --all-features -- -D 
warnings` was also attempted on Windows. It reached an unrelated MSVC 
native-link failure while building `protobuf-src` (`LNK2005`/`LNK4098` in 
`protoc-gen-upb`); affected-crate clippy passed with warnings denied, and CI 
will run the full Linux workspace checks.
   
   No benchmark was run because this is an API convenience constructor that 
delegates to the existing constructor and does not change runtime execution.
   
   ## Are there any user-facing changes?
   
   Yes. This adds the public `Coercion::new_implicit_native` convenience API. 
It is additive and backward compatible; existing `new_implicit` callers 
continue to work unchanged.


-- 
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]

Reply via email to