Py Spark Final
Py Spark Final
pyspark
spark = SparkSession \
.builder \
.appName("Python Spark SQL basic example") \
.config("spark.some.config.option", "some-value") \
.getOrCreate()
CONTINUE
Terminal
Powered By Katacoda
Creating a DataFrame
Create a DataFrame:
df.printSchema()
More Operations
Describe the column 'Age', and observe the various statistical parameters:
df.describe('Age').show()
Select the columns ID, Name, and Age, and display the result in descending order:
df.select('ID','Name','Age').orderBy('Name',ascending=False).show()
spark.stop()
exit()