How to Get the Size of Filtered Rows in Databricks SQL

vidya_kothavale
Contributor

I have a query that filters rows from a table based on a timestamp range. The query is as follows:

SELECT COUNT(*) FROM table_name WHERE ts >= '2025-02-04 00:00:00' AND ts < '2025-02-05 00:00:00';

This query returns 10 rows. I need to calculate the total size (in bytes) of these 10 rows.

What is the best approach in Databricks SQL to get the exact size of these filtered rows?
is there a built-in function to get this information?