-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-32688][SQL][TEST] Add special values to LiteralGenerator for float and double #29515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
8c8313c
77d63ac
818abe2
1116d3d
2dce36e
9a3b983
d20a2ed
529aba8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,14 +70,22 @@ object LiteralGenerator { | |
|
|
||
| lazy val floatLiteralGen: Gen[Literal] = | ||
| for { | ||
| f <- Gen.chooseNum(Float.MinValue / 2, Float.MaxValue / 2, | ||
| Float.NaN, Float.PositiveInfinity, Float.NegativeInfinity) | ||
| f <- Gen.oneOf( | ||
| Gen.oneOf( | ||
| Float.NaN, Float.PositiveInfinity, Float.NegativeInfinity, Float.MinPositiveValue, | ||
tanelk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 0.0f, -0.0f, 1.0f, -1.0f), | ||
|
||
| Arbitrary.arbFloat.arbitrary | ||
tanelk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ) | ||
tanelk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } yield Literal.create(f, FloatType) | ||
|
|
||
| lazy val doubleLiteralGen: Gen[Literal] = | ||
| for { | ||
| f <- Gen.chooseNum(Double.MinValue / 2, Double.MaxValue / 2, | ||
| Double.NaN, Double.PositiveInfinity, Double.NegativeInfinity) | ||
| f <- Gen.oneOf( | ||
| Gen.oneOf( | ||
| Double.NaN, Double.PositiveInfinity, Double.NegativeInfinity, Double.MinPositiveValue, | ||
| 0.0, -0.0, 1.0, -1.0), | ||
| Arbitrary.arbDouble.arbitrary | ||
| ) | ||
| } yield Literal.create(f, DoubleType) | ||
|
|
||
| // TODO cache the generated data | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.