Skip to content

[BUG] Binary Operations between fixed_point and floating-point not supported #16090

@pmattione-nvidia

Description

@pmattione-nvidia

Describe the bug
Some of the binary operators in cuDF no longer work between fixed_point and floating-point numbers after this PR removed the ability to construct and implicitly cast fixed_point numbers from floating point numbers.

Steps/Code to reproduce bug

  cudf::test::fixed_width_column_wrapper<double> double_col({1.0});
  auto decimal_value = cudf::convert_floating_to_fixed<numeric::decimal128>(1.0, numeric::scale_type{-1});
  cudf::test::fixed_width_column_wrapper<numeric::decimal128> decimal128_col({decimal_value});
  
  auto result = binary_operation(
    double_col,
    decimal128_col,
    cudf::binary_operator::EQUAL,
    cudf::data_type(cudf::type_id::BOOL8));

  auto expected = cudf::test::fixed_width_column_wrapper<bool>{true};
  CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, *result.get());

Expected behavior
Binary operations should work between fixed_point and floating-point.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions