Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22455#discussion_r219030350
  
    --- Diff: docs/sparkr.md ---
    @@ -450,6 +450,42 @@ print(model.summaries)
     {% endhighlight %}
     </div>
     
    +### Eager execution
    +
    +If the eager execution is enabled, the data will be returned to R client 
immediately when the `SparkDataFrame` is created. Eager execution can be 
enabled by setting the configuration property 
`spark.sql.repl.eagerEval.enabled` to `true` when the `SparkSession` is started 
up.
    +
    +<div data-lang="r" markdown="1">
    +{% highlight r %}
    +
    +# Start up spark session with eager execution enabled
    +sparkR.session(master = "local[*]", sparkConfig = 
list(spark.sql.repl.eagerEval.enabled = "true"))
    +
    +df <- createDataFrame(faithful)
    +
    +# Instead of displaying the SparkDataFrame class, displays the data 
returned
    +df
    +
    +##+---------+-------+                                                      
       
    +##|eruptions|waiting|
    +##+---------+-------+
    +##|      3.6|   79.0|
    +##|      1.8|   54.0|
    +##|    3.333|   74.0|
    +##|    2.283|   62.0|
    +##|    4.533|   85.0|
    +##|    2.883|   55.0|
    +##|      4.7|   88.0|
    +##|      3.6|   85.0|
    +##|     1.95|   51.0|
    +##|     4.35|   85.0|
    +##+---------+-------+
    +##only showing top 10 rows
    +
    +{% endhighlight %} 
    +</div>
    +
    +Note that the `SparkSession` created by `sparkR` shell does not have eager 
execution enabled. You can stop the current session and start up a new session 
like above to enable.
    --- End diff --
    
    actually I think the suggestion should be to set that in the `sparkR` 
command line as spark conf?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to