Skip to content

Commit f9e46c1

Browse files
committed
Use generate function and comment MinPositiveValue
1 parent b90aa8f commit f9e46c1

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

spark/src/test/scala/org/apache/comet/CometCastSuite.scala

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -105,38 +105,11 @@ class CometCastSuite extends CometTestBase with AdaptiveSparkPlanHelper {
105105
}
106106

107107
test("cast double to string") {
108-
val testValues = (
109-
Seq(
110-
1.0499721536516571e-4,
111-
0.001,
112-
10000000.0,
113-
9999999.0,
114-
Float.NegativeInfinity,
115-
Float.PositiveInfinity,
116-
Float.MinPositiveValue,
117-
Double.MinValue,
118-
Double.MaxValue,
119-
Double.NaN,
120-
0.0,
121-
-0.0)
122-
).toDF("a")
123-
castTest(testValues, DataTypes.StringType)
108+
castTest(generateDoubles(), DataTypes.StringType)
124109
}
125110

126111
test("cast float to string") {
127-
val testValues = (
128-
Seq(
129-
1.0499721536516571e-4,
130-
0.001f,
131-
10000000.0f,
132-
9999999.0f,
133-
Float.MinValue,
134-
Float.MaxValue,
135-
Float.NaN,
136-
0.0f,
137-
-0.0f)
138-
).toDF("a")
139-
castTest(testValues, DataTypes.StringType)
112+
castTest(generateFloats(), DataTypes.StringType)
140113
}
141114

142115
test("cast BooleanType to LongType") {
@@ -704,7 +677,7 @@ class CometCastSuite extends CometTestBase with AdaptiveSparkPlanHelper {
704677
val r = new Random(0)
705678
val values = Seq(
706679
Float.MaxValue,
707-
Float.MinPositiveValue,
680+
// Float.MinPositiveValue,
708681
Float.MinValue,
709682
Float.NaN,
710683
Float.PositiveInfinity,
@@ -722,7 +695,7 @@ class CometCastSuite extends CometTestBase with AdaptiveSparkPlanHelper {
722695
val r = new Random(0)
723696
val values = Seq(
724697
Double.MaxValue,
725-
Double.MinPositiveValue,
698+
// Double.MinPositiveValue,
726699
Double.MinValue,
727700
Double.NaN,
728701
Double.PositiveInfinity,

0 commit comments

Comments
 (0)