To get all the tables of a schema, sample in this case, you could use this code:
\trim SELECT
'select '+x'27',
table_name as "table name",
x'27'+', count(*) from sample.',
table_name as tablename
FROM information_schema.tables where table_schema = 'sample'
FETCH FIRST 1 ROW ONLY;
SELECT
'union all',
'select '+x'27',
table_name as "table name",
x'27'+', count(*) from sample.',
table_name as tablename
FROM information_schema.tables where table_schema = 'sample'
OFFSET 1;
\g
You could put this in a script to enhance it further: call the script giving the SQL connectivity string to the respective warehouse and optionally the schema name. Output is in comma-separated format ready to be loaded anywhere.