-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem or challenge?
When fixing #11076, I noticed that not every method in ScalarValue supports a ScalarValue::Float16 while supporting Float32 and Float64:
For example in (from #11076):
datafusion/datafusion/common/src/scalar/mod.rs
Line 1170 in 3051d19
| pub fn arithmetic_negate(&self) -> Result<Self> { |
We see that F32 and F64 are supported, but not F16
datafusion/datafusion/common/src/scalar/mod.rs
Lines 1178 to 1179 in 3051d19
| ScalarValue::Float64(Some(v)) => Ok(ScalarValue::Float64(Some(-v))), | |
| ScalarValue::Float32(Some(v)) => Ok(ScalarValue::Float32(Some(-v))), |
Describe the solution you'd like
- Every method that supports Float32 and Float64 should support Float16 (including constructors)
- implement
From<f16>for ScalarValue - Add tests
- More to do?
half::f16 supports many of these operations, so I think it is doable. ArrowNativeType and ArrowNativeTypeOp are also implemented so we can use a lot of functions from that trait.
Describe alternatives you've considered
Maybe show in docs why Float16 is not supported in some cases?
Additional context
Can this be a "good first issue" ?
No response
alamb
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request