'BigQuery external queries with union all

I want to show data in BigQuery from two external queries I'm trying to use UNION ALL, but I'm getting the data as join This is what I'm trying to do:

SELECT *
FROM (
EXTERNAL_QUERY("connection_path1", "query1")
UNION ALL
EXTERNAL_QUERY("connection_pat2", "query2")
)

I'm getting this error:

Syntax error: Expected keyword JOIN but got keyword UNION at 

How can I achieve UNION ALL in big-query?



Solution 1:[1]

Use below instead

SELECT * FROM EXTERNAL_QUERY("connection_path1", "query1")
UNION ALL
SELECT * FROM EXTERNAL_QUERY("connection_pat2", "query2")

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mikhail Berlyant