title: What is the difference between dataframe.show() and dataframe.take() in spark? To increase the performance what we need to increase?
body: <p>I am using dataframes to read data from parquet files and creating a temporary view and running SQL queries on top the temp views.</p>
  
  <p><code>spark.read.parquet("filename.parquet").createOrReplaceTempView("temptable")</code></p>
  
  <p><code>val df = spark.sql("SELECT * FROM temptable")</code></p>
  
  <p>to check the result of <code>df</code> i am using <code>df.show()</code> but it takes more to execute and I did not see any difference if I use <code>df.take(10)</code></p>
  
  <p><strong>IS there any difference between <code>take()</code> and <code>show()</code>.which method should I use for better performance to check the results</strong></p>