How to get the size of selected rows in bytes using a single SQL query?

Akshay_Petkar
Valued Contributor

Hi all,

I have a table named employee in Databricks. I ran the following query to filter out rows where the salary is greater than 25000.

This query returns 10 rows. I want to find the size of these 10 rows in bytes, and I would like to calculate or retrieve this size only within the same query. How can I achieve this?

Any help would be appreciated!

Akshay Petkar