I am looking for single query which can tell me if given schema is empty?
You could write single query that search in INFORMATION_SCHEMA:
SET schema_name = 'MY_SCHEMA';
SELECT $schema_name AS schema_name,
CASE WHEN EXISTS (
SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA ILIKE $schema_name
UNION ALL
SELECT 1 FROM INFORMATION_SCHEMA.SEQUENCES WHERE SEQUENCE_SCHEMA ILIKE $schema_name
UNION ALL
-- all information_schema tables tasks/sequences/functions/streams/...
) THEN 0
ELSE 1
END is_empty;
Alternatively using SHOW:
SHOW TABLES IN SCHEMA 'schema_name';
SHOW TASKS IN SCHEMA 'schema_name;
-- ... all SHOW commands
SELECT 1 FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()))
UNION ALL
SELECT 1 FROM TABLE(RESULT_SCAN(LAST_QUERY_ID(-2)))
...
-- if returns 1 it means that at least one SHOW command returned rows
-- therefore it contains object in schema
Warning!
Both approaches may return false negative as you are able to see only objects you have access to.