I can use variables for query filtering conditions. E.g.,
set mytime = '2021-12-12 09:00:00';
select col1
from db1.schema.table1
where event_time > $mytime
However, if I use the same way to replace the db1 with a variable, it will not work. I.e.,
set mytime = '2021-12-12 09:00:00';
set db_name = 'db1';
select col1
from $db_name.schema.table1
where event_time > $mytime