Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 09:04 AM
@Raman Gupta - Please refer to the below
Calculate the size of the Delta table:
%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}"calculate the size of the non delta table:
%scala
spark.read.table("non-delta-table-name").queryExecution.analyzed.stats