Skip to content
Snippets Groups Projects
Commit a0fe32a2 authored by Wang Gengliang's avatar Wang Gengliang Committed by gatorsmile
Browse files

[SPARK-21336] Revise rand comparison in BatchEvalPythonExecSuite

## What changes were proposed in this pull request?

Revise rand comparison in BatchEvalPythonExecSuite

In BatchEvalPythonExecSuite, there are two cases using the case "rand() > 3"
Rand() generates a random value in [0, 1), it is wired to be compared with 3, use 0.3 instead

## How was this patch tested?

unit test

Please review http://spark.apache.org/contributing.html before opening a pull request.

Author: Wang Gengliang <ltnwgl@gmail.com>

Closes #18560 from gengliangwang/revise_BatchEvalPythonExecSuite.
parent fbbe37ed
No related branches found
No related tags found
No related merge requests found
......@@ -65,7 +65,7 @@ class BatchEvalPythonExecSuite extends SparkPlanTest with SharedSQLContext {
test("Python UDF: no push down on non-deterministic") {
val df = Seq(("Hello", 4)).toDF("a", "b")
.where("b > 4 and dummyPythonUDF(a) and rand() > 3")
.where("b > 4 and dummyPythonUDF(a) and rand() > 0.3")
val qualifiedPlanNodes = df.queryExecution.executedPlan.collect {
case f @ FilterExec(
And(_: AttributeReference, _: GreaterThan),
......@@ -77,7 +77,7 @@ class BatchEvalPythonExecSuite extends SparkPlanTest with SharedSQLContext {
test("Python UDF: no push down on predicates starting from the first non-deterministic") {
val df = Seq(("Hello", 4)).toDF("a", "b")
.where("dummyPythonUDF(a) and rand() > 3 and b > 4")
.where("dummyPythonUDF(a) and rand() > 0.3 and b > 4")
val qualifiedPlanNodes = df.queryExecution.executedPlan.collect {
case f @ FilterExec(And(_: And, _: GreaterThan), InputAdapter(_: BatchEvalPythonExec)) => f
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment