@@ -1342,8 +1342,7 @@ impl ScalarValue {
13421342 /// Returns a [`ScalarValue`] representing PI's upper bound
13431343 pub fn new_pi_upper ( datatype : & DataType ) -> Result < ScalarValue > {
13441344 match datatype {
1345- // TODO: half::f16 doesn't seem to have equivalent
1346- // https://github.com/apache/datafusion/issues/19465
1345+ DataType :: Float16 => Ok ( ScalarValue :: Float16 ( Some ( consts:: PI_UPPER_F16 ) ) ) ,
13471346 DataType :: Float32 => Ok ( ScalarValue :: from ( consts:: PI_UPPER_F32 ) ) ,
13481347 DataType :: Float64 => Ok ( ScalarValue :: from ( consts:: PI_UPPER_F64 ) ) ,
13491348 _ => {
@@ -1355,8 +1354,9 @@ impl ScalarValue {
13551354 /// Returns a [`ScalarValue`] representing -PI's lower bound
13561355 pub fn new_negative_pi_lower ( datatype : & DataType ) -> Result < ScalarValue > {
13571356 match datatype {
1358- // TODO: half::f16 doesn't seem to have equivalent
1359- // https://github.com/apache/datafusion/issues/19465
1357+ DataType :: Float16 => {
1358+ Ok ( ScalarValue :: Float16 ( Some ( consts:: NEGATIVE_PI_LOWER_F16 ) ) )
1359+ }
13601360 DataType :: Float32 => Ok ( ScalarValue :: from ( consts:: NEGATIVE_PI_LOWER_F32 ) ) ,
13611361 DataType :: Float64 => Ok ( ScalarValue :: from ( consts:: NEGATIVE_PI_LOWER_F64 ) ) ,
13621362 _ => {
@@ -1368,8 +1368,9 @@ impl ScalarValue {
13681368 /// Returns a [`ScalarValue`] representing FRAC_PI_2's upper bound
13691369 pub fn new_frac_pi_2_upper ( datatype : & DataType ) -> Result < ScalarValue > {
13701370 match datatype {
1371- // TODO: half::f16 doesn't seem to have equivalent
1372- // https://github.com/apache/datafusion/issues/19465
1371+ DataType :: Float16 => {
1372+ Ok ( ScalarValue :: Float16 ( Some ( consts:: FRAC_PI_2_UPPER_F16 ) ) )
1373+ }
13731374 DataType :: Float32 => Ok ( ScalarValue :: from ( consts:: FRAC_PI_2_UPPER_F32 ) ) ,
13741375 DataType :: Float64 => Ok ( ScalarValue :: from ( consts:: FRAC_PI_2_UPPER_F64 ) ) ,
13751376 _ => {
@@ -1381,8 +1382,9 @@ impl ScalarValue {
13811382 // Returns a [`ScalarValue`] representing FRAC_PI_2's lower bound
13821383 pub fn new_neg_frac_pi_2_lower ( datatype : & DataType ) -> Result < ScalarValue > {
13831384 match datatype {
1384- // TODO: half::f16 doesn't seem to have equivalent
1385- // https://github.com/apache/datafusion/issues/19465
1385+ DataType :: Float16 => Ok ( ScalarValue :: Float16 ( Some (
1386+ consts:: NEGATIVE_FRAC_PI_2_LOWER_F16 ,
1387+ ) ) ) ,
13861388 DataType :: Float32 => {
13871389 Ok ( ScalarValue :: from ( consts:: NEGATIVE_FRAC_PI_2_LOWER_F32 ) )
13881390 }
0 commit comments