You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "Jefffrey (via GitHub)" <gi...@apache.org> on 2026/08/06 06:25:22 UTC
[I] `Coercion::new_implicit` is confusing when desired type is `TypeSignatureClass::Native` [datafusion]
Jefffrey opened a new issue, #24135:
URL: https://github.com/apache/datafusion/issues/24135
### Is your feature request related to a problem or challenge?
https://github.com/apache/datafusion/blob/f27e50c13647efa5292d5ef5b1e4ed6af3015962/datafusion/expr-common/src/signature.rs#L1102-L1119
Example usages:
https://github.com/apache/datafusion/blob/f27e50c13647efa5292d5ef5b1e4ed6af3015962/datafusion/functions/src/unicode/reverse.rs#L65-L69
https://github.com/apache/datafusion/blob/f27e50c13647efa5292d5ef5b1e4ed6af3015962/datafusion/functions-aggregate/src/approx_percentile_cont.rs#L142-L146
When `desired_type` is a `TypeSignatureClass::Native(_)`, its confusing to need to specify `default_casted_type` to be the same; we already know our desired native type.
### Describe the solution you'd like
Perhaps a new API like
```rust
pub fn new_implicit_native(
desired_type: LogicalTypeRef,
allowed_source_types: Vec<TypeSignatureClass>,
) -> Self {
Self::new_implicit(
TypeSignatureClass::Native(desired_type),
allowed_source_types,
desired_type.native().clone(),
)
}
```
Then we could use it like
```rust
Coercion::new_implicit_native(
logical_string(),
vec![TypeSignatureClass::Any],
)
```
And see where we can use this hopefully more intuitive API
### Describe alternatives you've considered
Is there a better/cleaner way to handle this? Open to suggestions
### Additional context
_No response_
--
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: github-unsubscribe@datafusion.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] `Coercion::new_implicit` is confusing when desired type is `TypeSignatureClass::Native` [datafusion]
Posted by "Jamison929611 (via GitHub)" <gi...@apache.org>.
Jamison929611 commented on issue #24135:
URL: https://github.com/apache/datafusion/issues/24135#issuecomment-5264034171
I'd like to work on this. I plan to add a focused `new_implicit_native` convenience constructor with tests, keep `new_implicit` backward compatible, and migrate only clear representative call sites.
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] `Coercion::new_implicit` is confusing when desired type is `TypeSignatureClass::Native` [datafusion]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey closed issue #24135: `Coercion::new_implicit` is confusing when desired type is `TypeSignatureClass::Native`
URL: https://github.com/apache/datafusion/issues/24135
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org