Skip to content

Commit 7f37d21

Browse files
committed
Makes DataFrame.rdd a lazy val
1 parent f75f633 commit 7f37d21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -941,10 +941,10 @@ class DataFrame private[sql](
941941
/////////////////////////////////////////////////////////////////////////////
942942

943943
/**
944-
* Returns the content of the [[DataFrame]] as an [[RDD]] of [[Row]]s.
944+
* Represents the content of the [[DataFrame]] as an [[RDD]] of [[Row]]s.
945945
* @group rdd
946946
*/
947-
def rdd: RDD[Row] = {
947+
lazy val rdd: RDD[Row] = {
948948
// use a local variable to make sure the map closure doesn't capture the whole DataFrame
949949
val schema = this.schema
950950
queryExecution.executedPlan.execute().map(ScalaReflection.convertRowToScala(_, schema))

0 commit comments

Comments
 (0)