Is there a way to know the query response size in Snowflake?
For example, in BigQuery we get the size from the temporal table created by BigQuery in a query job.
Thanks!
After you run a query you can always refer back to its cached results. All you need to know is the query id and scan for its results. Then you can determine the size of those results by whatever method you choose to measure the size - for example, the length of json encoding all columns.
In code:
-- run a query then get its id
set last_query_id = (select last_query_id());
select sum(length(to_json(object_construct(a.*)))) table_encoded_size
from table(result_scan($last_query_id)) a;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With