@@ -423,8 +423,8 @@ class DatasetSuite extends QueryTest with SharedSQLContext {
423
423
}
424
424
425
425
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!" )
428
428
1
429
429
})
430
430
@@ -439,12 +439,12 @@ class DatasetSuite extends QueryTest with SharedSQLContext {
439
439
(7 , " string7" ),
440
440
(8 , " string8" ),
441
441
(9 , " string9" )
442
- ).toDF(" swid " , " stringData" )
442
+ ).toDF(" id " , " stringData" )
443
443
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 )))
448
448
}
449
449
450
450
test(" SPARK-11436: we should rebind right encoder when join 2 datasets" ) {
0 commit comments