apache / datafusion-comet

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

feat: Implement Spark-compatible CAST from floating-point/double to decimal #384

Closed vaibhawvipul closed 3 weeks ago

vaibhawvipul commented 3 weeks ago

Which issue does this PR close?

Closes #371

Rationale for this change

Improve compatibility with spark

What changes are included in this PR?

Add custom implementation of CAST from double to timestamp to handle eval_modes if error in casting.

How are these changes tested?

CometCastSuite test case passes.

andygrove commented 3 weeks ago

This is looking good @vaibhawvipul.

andygrove commented 3 weeks ago

@vaibhawvipul Do you plan on supporting FloatType -> DecimalType as well as DoubleType -> DecimalType in this PR?

vaibhawvipul commented 3 weeks ago

@vaibhawvipul Do you plan on supporting FloatType -> DecimalType as well as DoubleType -> DecimalType in this PR?

@andygrove - This PR now supports both FloatType/DoubleType -> DecimalType.

codecov-commenter commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 34.00%. Comparing base (9ab6c75) to head (a8dcdea). Report is 60 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #384 +/- ## ============================================ + Coverage 33.47% 34.00% +0.53% - Complexity 795 857 +62 ============================================ Files 110 116 +6 Lines 37533 38552 +1019 Branches 8215 8513 +298 ============================================ + Hits 12563 13110 +547 - Misses 22322 22690 +368 - Partials 2648 2752 +104 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.