Get Started with Google Cloud — selected guide
Querying Cloud SQL from BigQuery
Twelve practical entries spanning docs, networking, storage, IAM, cost, data, workflows, and APIs
Twelve 2018–2022 introductions use small tasks to explain networking, persistent storage, access control, BigQuery queries and cost limits, object versions, sensitive-data inspection, workflow orchestration, and speech transcription.
Google Cloud Tech 8 of 12
In this collection Browse 12 summaries 8 of 12
This example configures a BigQuery federated query to read MySQL or PostgreSQL data in Cloud SQL without first copying it into BigQuery. 00:01–01:03(opens in a new tab)
Key Points Covered
- Create a reusable connection. The connection identifies the Cloud SQL instance and database, stores database credentials, and has a location compatible with the data being queried. Users receive permission to query through that connection. 02:06–04:12(opens in a new tab)
- Run part of the query where the data lives.
EXTERNAL_QUERYtakes the connection ID and a query written in the external database's SQL dialect. In the example, it retrieves employee numbers and hire dates from Cloud SQL; BigQuery joins those results to its own salary table and calculates average salary by hire year. 03:09–05:13(opens in a new tab) - Database credentials also set the access boundary. The presenter warns that if those credentials can read other databases in the same instance, the connection can query those databases too. 02:06–03:09(opens in a new tab)
- BigQuery cannot estimate how much external data will be processed before the federated query runs; the amount becomes known afterward. 04:12–05:13(opens in a new tab)
Full video: https://www.youtube.com/watch?v=0cyTHbkARwY(opens in a new tab)