apache / datafusion-comet

Apache DataFusion Comet Spark Accelerator
https://datafusion.apache.org/comet
Apache License 2.0
447 stars 100 forks source link

Implement Spark-compatible CAST from floating-point to decimal #371

Closed andygrove closed 1 week ago

andygrove commented 2 weeks ago

What is the problem the feature request solves?

Comet's implementation of CAST float/double to Decimal delegates to DataFusion and is not compatible with Spark.

The following test in CometCastSuite can be used to see the current failures.

  ignore("cast DoubleType to DecimalType(10,2)") {
    // Comet should have failed with [NUMERIC_VALUE_OUT_OF_RANGE]
    castTest(generateDoubles(), DataTypes.createDecimalType(10, 2))
  }

Describe the potential solution

No response

Additional context

No response

vaibhawvipul commented 2 weeks ago

I would like to work on this.