QuestionQ148Verified/Developing Apache Spark™ DataFrame/DataSet API ApplicationsCopy linkReport a problemAsk AstroTutorSave questionWhich of the following code blocks returns every row from the DataFrame storesDF?AstoresDF.head()BstoresDF.collect()CstoresDF.count()DstoresDF.take()EstoresDF.show()Show AnswerAnswerExplanationDataFrame.collect() returns all records in a PySpark DataFrame as a list of Row objects. It should be used only when the complete result is small enough to fit in the driver’s memory.Learn morepyspark.sql.DataFrame.collect — PySpark documentationShow comments1Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion