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

feat: Implement Spark-compatible CAST from String to Decimal

Open sujithjay opened this issue 1 year ago • 5 comments

Which issue does this PR close?

Closes #325.

Rationale for this change

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

This PR implements a Spark-compatible cast from String to Decimal.

What changes are included in this PR?

An implementation of parse_decimal copied from arrow-rs, modified to be compatible with Spark's behavior.

How are these changes tested?

  • The test underCometCastSuite now passes.
  • Unit tests were introduced in cast.rs.

sujithjay avatar Jun 30 '24 20:06 sujithjay

@kevinmingtarja, thank you for helping me with a draft. Could you please take a look?

sujithjay avatar Jun 30 '24 20:06 sujithjay

@andygrove @vaibhawvipul Could you please take a look?

sujithjay avatar Jun 30 '24 20:06 sujithjay

@andygrove @vaibhawvipul Could you please take a look?

Apologies @sujithjay I had missed this ping. I will review this early next week.

andygrove avatar Jul 12 '24 21:07 andygrove

This is looking good @sujithjay. CI is failing due to clippy warnings. If you run clippy locally you should be able to see the same warnings as well as suggestions for fixing.

andygrove avatar Jul 12 '24 21:07 andygrove

@sujithjay I took the liberty of fixing the clippy issues and fixing the conflicts

andygrove avatar Jul 15 '24 14:07 andygrove

@sujithjay I will close this PR for now since it has been inactive for a while. Feel free to reopen this or create a new PR if you continue work on this.

andygrove avatar Oct 22 '24 16:10 andygrove