<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic What is the difference between DataFrame.first(), head(), head(n), and take(n), show(), show(n)? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/what-is-the-difference-between-dataframe-first-head-head-n-and/m-p/30414#M22051</link>
    <description />
    <pubDate>Wed, 17 Jun 2015 21:38:18 GMT</pubDate>
    <dc:creator>cfregly</dc:creator>
    <dc:date>2015-06-17T21:38:18Z</dc:date>
    <item>
      <title>What is the difference between DataFrame.first(), head(), head(n), and take(n), show(), show(n)?</title>
      <link>https://community.databricks.com/t5/data-engineering/what-is-the-difference-between-dataframe-first-head-head-n-and/m-p/30414#M22051</link>
      <description />
      <pubDate>Wed, 17 Jun 2015 21:38:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/what-is-the-difference-between-dataframe-first-head-head-n-and/m-p/30414#M22051</guid>
      <dc:creator>cfregly</dc:creator>
      <dc:date>2015-06-17T21:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: What is the difference between DataFrame.first(), head(), head(n), and take(n), show(), show(n)?</title>
      <link>https://community.databricks.com/t5/data-engineering/what-is-the-difference-between-dataframe-first-head-head-n-and/m-p/30415#M22052</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Sorted Data&lt;/B&gt;&lt;/P&gt;&lt;P&gt;If your data is sorted using either &lt;PRE&gt;&lt;CODE&gt;sort()&lt;/CODE&gt;&lt;/PRE&gt; or &lt;PRE&gt;&lt;CODE&gt;ORDER BY&lt;/CODE&gt;&lt;/PRE&gt;, these operations will be deterministic and return either the 1st element using first()/head() or the top-n using head(n)/take(n).&lt;/P&gt;&lt;P&gt;show()/show(n) return Unit (void) and will print up to the first 20 rows in a tabular form.&lt;/P&gt;&lt;P&gt;These operations may require a shuffle if there are any aggregations, joins, or sorts in the underlying query.&lt;/P&gt;&lt;P&gt;&lt;B&gt;Unsorted Data&lt;/B&gt;&lt;/P&gt;&lt;P&gt;If the data is not sorted, these operations are not guaranteed to return the 1st or top-n elements - and a shuffle may not be required.  &lt;/P&gt;&lt;P&gt;show()/show(n) return Unit (void) and will print up to 20 rows in a tabular form and in no particular order.&lt;/P&gt;&lt;P&gt;If no shuffle is required (no aggregations, joins, or sorts), these operations will be optimized to inspect enough partitions to satisfy the operation - likely a much smaller subset of the overall partitions of the dataset.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2015 21:48:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/what-is-the-difference-between-dataframe-first-head-head-n-and/m-p/30415#M22052</guid>
      <dc:creator>cfregly</dc:creator>
      <dc:date>2015-06-17T21:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: What is the difference between DataFrame.first(), head(), head(n), and take(n), show(), show(n)?</title>
      <link>https://community.databricks.com/t5/data-engineering/what-is-the-difference-between-dataframe-first-head-head-n-and/m-p/148422#M52889</link>
      <description>&lt;P&gt;These are action methods that return data -&lt;/P&gt;&lt;P&gt;first() : Returns the very first row of the dataframe as a single row.&lt;/P&gt;&lt;P&gt;head() : This does the same as first(), returns the first row&lt;/P&gt;&lt;P&gt;head(n): Returns an array or list of the first n rows&lt;/P&gt;&lt;P&gt;take(n): Similar to head(n), it retrieves the first n rows and returns them as an array&lt;/P&gt;&lt;P&gt;These action items display data-&lt;/P&gt;&lt;P&gt;show(): Prints the first 20 rows in a tabular format&lt;/P&gt;&lt;P&gt;show(n): Prints the first n rows in a tabular format&lt;/P&gt;</description>
      <pubDate>Sat, 14 Feb 2026 20:48:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/what-is-the-difference-between-dataframe-first-head-head-n-and/m-p/148422#M52889</guid>
      <dc:creator>DivyaandData</dc:creator>
      <dc:date>2026-02-14T20:48:42Z</dc:date>
    </item>
  </channel>
</rss>

