I have iceberg tables on aws.
i am trying to use Athena
or presto
to query them.
My question is: how to know the data contribution from each table to the result.
e.g. How to know how many rows in the result are from table A and table B?
(select * from table A where XXX)
union
(select * from table B where YYY)
As for Athena, I am trying to use .html, but it seems that there are no what i want.
it is possible to get the information from presto query metadata?
Any comments welcomed.
Thanks
I have iceberg tables on aws.
i am trying to use Athena
or presto
to query them.
My question is: how to know the data contribution from each table to the result.
e.g. How to know how many rows in the result are from table A and table B?
(select * from table A where XXX)
union
(select * from table B where YYY)
As for Athena, I am trying to use https://docs.aws.amazon/cli/latest/reference/athena/get-query-runtime-statistics.html, but it seems that there are no what i want.
it is possible to get the information from presto query metadata?
Any comments welcomed.
Thanks
Share Improve this question asked Nov 19, 2024 at 1:20 hehe123456hehe123456 1712 silver badges5 bronze badges 1- Can you please elaborate? Or add some sample data and desired output? – Guru Stron Commented Nov 19, 2024 at 10:20
1 Answer
Reset to default 0There is no direct method to know this. You can use count to know this. The below way to adjust query.
SELECT
'table_a' AS source_table,
COUNT(*) AS contribution_count
FROM
table_a a
LEFT JOIN
table_b b
ON
amon_key = bmon_key
GROUP BY
source_table
UNION ALL
SELECT
'table_b' AS source_table,
COUNT(*) AS contribution_count
FROM
table_b b
LEFT JOIN
table_a a
ON
bmon_key = amon_key
GROUP BY
source_table;
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745587369a4634625.html
评论列表(0条)