QuestionQ157
VerifiedTroubleshooting and Tuning Apache Spark DataFrame API Applications.A data scientist is using a large Apache Spark dataset and has written the following code:
df = spark.read.csv(“large_dataset.csv”)
filtered_df = df.filter(col(“error_column”).contains(“error”))
mapped_df = filtered_df.select(split(col(“timestamp”), “ “).getItem(0).alias(“date”), lit(1).alias(“count”))
reduced_df = mapped_df.groupBy(“date”).sum(“count”)
reduced_df.count()
reduced_df.show()
At what point in this code does Spark actually start processing the data?
Community Discussion