-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Labels
enhancementNew feature or requestNew feature or request
Description
See these four functions:
datafusion/datafusion/common/src/scalar/mod.rs
Lines 1342 to 1353 in 33ac70d
| /// Returns a [`ScalarValue`] representing PI's upper bound | |
| pub fn new_pi_upper(datatype: &DataType) -> Result<ScalarValue> { | |
| match datatype { | |
| // TODO: half::f16 doesn't seem to have equivalent | |
| // https://github.com/apache/datafusion/issues/19465 | |
| DataType::Float32 => Ok(ScalarValue::from(consts::PI_UPPER_F32)), | |
| DataType::Float64 => Ok(ScalarValue::from(consts::PI_UPPER_F64)), | |
| _ => { | |
| _internal_err!("PI_UPPER is not supported for data type: {}", datatype) | |
| } | |
| } | |
| } |
datafusion/datafusion/common/src/scalar/mod.rs
Lines 1355 to 1366 in 33ac70d
| /// Returns a [`ScalarValue`] representing -PI's lower bound | |
| pub fn new_negative_pi_lower(datatype: &DataType) -> Result<ScalarValue> { | |
| match datatype { | |
| // TODO: half::f16 doesn't seem to have equivalent | |
| // https://github.com/apache/datafusion/issues/19465 | |
| DataType::Float32 => Ok(ScalarValue::from(consts::NEGATIVE_PI_LOWER_F32)), | |
| DataType::Float64 => Ok(ScalarValue::from(consts::NEGATIVE_PI_LOWER_F64)), | |
| _ => { | |
| _internal_err!("-PI_LOWER is not supported for data type: {}", datatype) | |
| } | |
| } | |
| } |
datafusion/datafusion/common/src/scalar/mod.rs
Lines 1368 to 1379 in 33ac70d
| /// Returns a [`ScalarValue`] representing FRAC_PI_2's upper bound | |
| pub fn new_frac_pi_2_upper(datatype: &DataType) -> Result<ScalarValue> { | |
| match datatype { | |
| // TODO: half::f16 doesn't seem to have equivalent | |
| // https://github.com/apache/datafusion/issues/19465 | |
| DataType::Float32 => Ok(ScalarValue::from(consts::FRAC_PI_2_UPPER_F32)), | |
| DataType::Float64 => Ok(ScalarValue::from(consts::FRAC_PI_2_UPPER_F64)), | |
| _ => { | |
| _internal_err!("PI_UPPER/2 is not supported for data type: {}", datatype) | |
| } | |
| } | |
| } |
datafusion/datafusion/common/src/scalar/mod.rs
Lines 1381 to 1396 in 33ac70d
| // Returns a [`ScalarValue`] representing FRAC_PI_2's lower bound | |
| pub fn new_neg_frac_pi_2_lower(datatype: &DataType) -> Result<ScalarValue> { | |
| match datatype { | |
| // TODO: half::f16 doesn't seem to have equivalent | |
| // https://github.com/apache/datafusion/issues/19465 | |
| DataType::Float32 => { | |
| Ok(ScalarValue::from(consts::NEGATIVE_FRAC_PI_2_LOWER_F32)) | |
| } | |
| DataType::Float64 => { | |
| Ok(ScalarValue::from(consts::NEGATIVE_FRAC_PI_2_LOWER_F64)) | |
| } | |
| _ => { | |
| _internal_err!("-PI/2_LOWER is not supported for data type: {}", datatype) | |
| } | |
| } | |
| } |
We should look for a solution that does not involve casting the f32 constant to a f16.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request