<?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 Re: how to find the size of a table in python or sql? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-find-the-size-of-a-table-in-python-or-sql/m-p/26637#M18663</link>
    <description>&lt;P&gt;@Raman Gupta​&amp;nbsp;- could you please try the below &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%python
spark.sql("describe detail delta-table-name").select("sizeInBytes").collect()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Oct 2022 17:54:01 GMT</pubDate>
    <dc:creator>shan_chandra</dc:creator>
    <dc:date>2022-10-19T17:54:01Z</dc:date>
    <item>
      <title>how to find the size of a table in python or sql?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-find-the-size-of-a-table-in-python-or-sql/m-p/26632#M18658</link>
      <description>&lt;P&gt;let's suppose there is a database db, inside that so many tables are there and , i want to get the size of tables . how to get in either sql, python, pyspark.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;even if i have to get one by one it's fine. &lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 11:01:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-find-the-size-of-a-table-in-python-or-sql/m-p/26632#M18658</guid>
      <dc:creator>ramankr48</dc:creator>
      <dc:date>2022-10-19T11:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the size of a table in python or sql?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-find-the-size-of-a-table-in-python-or-sql/m-p/26633#M18659</link>
      <description>&lt;P&gt;&lt;I&gt;DESCRIBE DETAIL table_name &lt;/I&gt;returns the sizeInBytes&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 13:01:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-find-the-size-of-a-table-in-python-or-sql/m-p/26633#M18659</guid>
      <dc:creator>elgeo</dc:creator>
      <dc:date>2022-10-19T13:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the size of a table in python or sql?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-find-the-size-of-a-table-in-python-or-sql/m-p/26634#M18660</link>
      <description>&lt;P&gt;Describe detail give you only the size of the latest snapshot. It's worth running a&amp;nbsp;&lt;A href="https://dbutils.fs.ls/" alt="https://dbutils.fs.ls/" target="_blank"&gt;dbutils.fs.ls&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 14:58:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-find-the-size-of-a-table-in-python-or-sql/m-p/26634#M18660</guid>
      <dc:creator>youssefmrini</dc:creator>
      <dc:date>2022-10-19T14:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the size of a table in python or sql?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-find-the-size-of-a-table-in-python-or-sql/m-p/26635#M18661</link>
      <description>&lt;P&gt;@Raman Gupta​&amp;nbsp;- Please refer to the below &lt;/P&gt;&lt;P&gt;Calculate the size of the Delta table:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%scala 
import com.databricks.sql.transaction.tahoe._
val deltaLog = DeltaLog.forTable(spark, "dbfs:/delta-table-path")
val snapshot = deltaLog.snapshot                     // the current delta table snapshot
println(s"Total file size (bytes): ${deltaLog.snapshot.sizeInBytes}"&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;calculate the size of the non delta table:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%scala
spark.read.table("non-delta-table-name").queryExecution.analyzed.stats&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 16:04:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-find-the-size-of-a-table-in-python-or-sql/m-p/26635#M18661</guid>
      <dc:creator>shan_chandra</dc:creator>
      <dc:date>2022-10-19T16:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the size of a table in python or sql?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-find-the-size-of-a-table-in-python-or-sql/m-p/26636#M18662</link>
      <description>&lt;P&gt;Already know in scala.&lt;/P&gt;&lt;P&gt;I wanted this in either python or sql&lt;/P&gt;&lt;P&gt;scala link: &lt;A href="https://kb.databricks.com/sql/find-size-of-table.html#:~:text=To%20find%20the%20size%20of%20a%20delta%20table%2C,println%20%28s%20%22Total%20file%20size%20%28bytes%29%3A%20%24%20%7BdeltaLog.snapshot.sizeInBytes%7D%22%29" target="test_blank"&gt;https://kb.databricks.com/sql/find-size-of-table.html#:~:text=To%20find%20the%20size%20of%20a%20delta%20table%2C,println%20%28s%20%22Total%20file%20size%20%28bytes%29%3A%20%24%20%7BdeltaLog.snapshot.sizeInBytes%7D%22%29&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 17:36:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-find-the-size-of-a-table-in-python-or-sql/m-p/26636#M18662</guid>
      <dc:creator>ramankr48</dc:creator>
      <dc:date>2022-10-19T17:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the size of a table in python or sql?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-find-the-size-of-a-table-in-python-or-sql/m-p/26637#M18663</link>
      <description>&lt;P&gt;@Raman Gupta​&amp;nbsp;- could you please try the below &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%python
spark.sql("describe detail delta-table-name").select("sizeInBytes").collect()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 17:54:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-find-the-size-of-a-table-in-python-or-sql/m-p/26637#M18663</guid>
      <dc:creator>shan_chandra</dc:creator>
      <dc:date>2022-10-19T17:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the size of a table in python or sql?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-find-the-size-of-a-table-in-python-or-sql/m-p/26638#M18664</link>
      <description>&lt;P&gt;Thanks @Shanmugavel Chandrakasu​&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 05:26:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-find-the-size-of-a-table-in-python-or-sql/m-p/26638#M18664</guid>
      <dc:creator>ramankr48</dc:creator>
      <dc:date>2022-10-20T05:26:56Z</dc:date>
    </item>
  </channel>
</rss>

