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;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…