File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
sql/core/src/test/scala/org/apache/spark/sql Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -137,13 +137,12 @@ class SQLQuerySuite extends QueryTest with BeforeAndAfterAll with SQLTestUtils {
137137
138138 test(" SPARK-7158 collect and take return different results" ) {
139139 import java .util .UUID
140- import org .apache .spark .sql .types ._
141140
142141 val df = Seq (Tuple1 (1 ), Tuple1 (2 ), Tuple1 (3 )).toDF(" index" )
143142 // we except the id is materialized once
144- def id : () => String = ( ) => { UUID .randomUUID().toString() }
143+ val idUdf = udf(( ) => UUID .randomUUID().toString)
145144
146- val dfWithId = df.withColumn(" id" , callUDF(id, StringType ))
145+ val dfWithId = df.withColumn(" id" , idUdf( ))
147146 // Make a new DataFrame (actually the same reference to the old one)
148147 val cached = dfWithId.cache()
149148 // Trigger the cache
You can’t perform that action at this time.
0 commit comments