You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "kazuyukitanimura (via GitHub)" <gi...@apache.org> on 2024/04/30 01:34:13 UTC
Re: [PR] feat: Implement Spark-compatible CAST float/double to string [datafusion-comet]
kazuyukitanimura commented on code in PR #346:
URL: https://github.com/apache/datafusion-comet/pull/346#discussion_r1584018114
##########
spark/src/test/scala/org/apache/comet/CometCastSuite.scala:
##########
@@ -55,8 +55,39 @@ class CometCastSuite extends CometTestBase with AdaptiveSparkPlanHelper {
castTest(generateFloats, DataTypes.IntegerType)
}
- ignore("cast float to string") {
- castTest(generateFloats, DataTypes.StringType)
+ test("cast double to string") {
+ val testValues = (
+ Seq(
+ 1.0499721536516571e-4,
+ 0.001,
+ 10000000.0,
+ 9999999.0,
+ Float.NegativeInfinity,
+ Float.PositiveInfinity,
+ Float.MinPositiveValue,
+ Double.MinValue,
+ Double.MaxValue,
+ Double.NaN,
+ 0.0,
+ -0.0)
+ ).toDF("a")
+ castTest(testValues, DataTypes.StringType, testAnsiModeThrows = false)
Review Comment:
#351 will add some data generation function with random number. May need to rebase on it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org