Skip to content

Commit af17bdf

Browse files
authored
Merge pull request #859 from marcraminv/doc/replace-spark-init-line
[Doc] Change Spark Python Notebook entry point sentence
2 parents f8c3e3d + 23c1376 commit af17bdf

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

docs/using/specifics.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ Spark local mode is useful for experimentation on small data when you do not hav
1313
#### In a Python Notebook
1414

1515
```python
16-
import pyspark
17-
sc = pyspark.SparkContext('local[*]')
18-
16+
from pyspark.sql import SparkSession
17+
spark = SparkSession.builder.appName("SimpleApp").getOrCreate()
1918
# do something to prove it works
20-
rdd = sc.parallelize(range(1000))
21-
rdd.takeSample(False, 5)
19+
spark.sql('SELECT "Test" as c1').show()
2220
```
2321

2422
#### In a R Notebook

0 commit comments

Comments
 (0)