
What does .show() do in Spark? | ⚡Flash in 45s | #pudhuData #Shorts
⚡️ Learn Spark in 45 Seconds – Short & Sharp from pudhuData ⚡️
📌 What is .show() in Apache Spark?
The `.show()` method in Spark is used to *display the contents of a DataFrame* in a tabular format. It’s especially useful for quickly previewing data during development or debugging.
🧪 Syntax:
dataFrame.show()
📊 Example:
val empDF = spark.read.option("header", "true").csv("employees.csv")
empDF.show()
💡 Tips:
By default, `.show()` displays 20 rows and truncates long columns. Use `.show(50, false)` to show 50 rows without truncation.
Ideal for checking data quality, nulls, and schema conformity before transformations.
Avoid using `.show()` in production pipelines—it's meant for dev/interactive sessions.
📚 Official Docs:
https://spark.apache.org/docs/latest/api/s...
📌 Watch more Databricks & Apache Spark Shorts on this channel!
#SparkShow #DataFrame #ApacheSpark #Databricks #BigData #pudhuData #SparkInterviewQuestions #DataEngineering #SparkShorts #DataScience
コメント