I have a list which contain tablename like table A, table B , table C ... etc. This list of tables may change depend upon some conditions . Sometime list may have 4 tables or 6 tables .
tables = [table A, table B , table C, table D]
schema definition of tables present in list is same .
i want to generate a query as below .
select col A from table A
union distinct
select col A from table B
union distinct
select col A from table C
union distinct select col A
from table D
size of query may increase or decrease depending upon tables in list
Once query is prepared . its needs to be executed in bigquery via python