Skip to content

Commit dc70f1d

Browse files
committed
Use proper name.
1 parent 20e9436 commit dc70f1d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,8 @@ class DatasetSuite extends QueryTest with SharedSQLContext {
423423
}
424424

425425
test("SPARK-16686: Dataset.sample with seed results shouldn't depend on downstream usage") {
426-
val udfOne = udf((n: Int) => {
427-
require(n != 1, "udfOne shouldn't see swid=1!")
426+
val simpleUdf = udf((n: Int) => {
427+
require(n != 1, "simpleUdf shouldn't see id=1!")
428428
1
429429
})
430430

@@ -439,12 +439,12 @@ class DatasetSuite extends QueryTest with SharedSQLContext {
439439
(7, "string7"),
440440
(8, "string8"),
441441
(9, "string9")
442-
).toDF("swid", "stringData")
442+
).toDF("id", "stringData")
443443
val sampleDF = df.sample(false, 0.7, 50)
444-
// After sampling, sampleDF doesn't contain swid=1.
445-
assert(!sampleDF.select("swid").collect.contains(1))
446-
// udfOne should not encounter swid=1.
447-
checkAnswer(sampleDF.select(udfOne($"swid")), List.fill(sampleDF.count.toInt)(Row(1)))
444+
// After sampling, sampleDF doesn't contain id=1.
445+
assert(!sampleDF.select("id").collect.contains(1))
446+
// simpleUdf should not encounter id=1.
447+
checkAnswer(sampleDF.select(simpleUdf($"id")), List.fill(sampleDF.count.toInt)(Row(1)))
448448
}
449449

450450
test("SPARK-11436: we should rebind right encoder when join 2 datasets") {

0 commit comments

Comments
 (0)