datafusion-comet icon indicating copy to clipboard operation
datafusion-comet copied to clipboard

Implement Spark-compatible CAST from String to Floating Point

Open andygrove opened this issue 1 year ago • 11 comments

What is the problem the feature request solves?

What is the problem the feature request solves?

We currently delegate to DataFusion when casting from string to floating point and there are some differences in behavior compared to Spark.

  • Spark supports inputs ending with d or f such as -12.34d and DataFusion does not
  • Spark ignores leading and trailing whitespace but DataFusion does not and returns null
  • DataFusion does not throw exceptions for invalid inputs in ANSI mode

Describe the potential solution

No response

Additional context

No response

andygrove avatar Apr 25 '24 13:04 andygrove

Hello,

I would like to work on this, if no one has started working on it. Also is there a reference PR to help new comers get started ?

psvri avatar Apr 25 '24 16:04 psvri

Hello,

I would like to work on this, if no one has started working on it. Also is there a reference PR to help new comers get started ?

Thanks @psvri. I am not aware that anyone else is working on this.

I have a PR in review for cast string to integer and that would be a good reference I think.

https://github.com/apache/datafusion-comet/pull/307

andygrove avatar Apr 25 '24 18:04 andygrove

FYI @psvri @mattharder91 just created a PR against this.

viirya avatar Apr 29 '24 17:04 viirya

@viirya hi I created a pr for float to string not string to float

mattharder91 avatar Apr 29 '24 17:04 mattharder91

@mattharder91 Er? I think you pointed your PR to this issue i.e., #326, no?

viirya avatar Apr 29 '24 17:04 viirya

@viirya oh sry that was my mistake I pin it to the other one.

mattharder91 avatar Apr 29 '24 17:04 mattharder91

Oh, you pointed to wrong issue, I corrected it to be #312 now.

viirya avatar Apr 29 '24 17:04 viirya

thank you and sry again

mattharder91 avatar Apr 29 '24 17:04 mattharder91

@mattharder91 no worries and thanks for your contribution!

viirya avatar Apr 29 '24 19:04 viirya

Hello,

I am not able to get time to work on this. If anyone else wants to try go ahead.

psvri avatar May 08 '24 13:05 psvri

Will do

mattharder91 avatar May 09 '24 18:05 mattharder91