Reputation: 886
I'm confused about the federated query syntax. I'm able to query for metadata with the default connection query in bq console:
SELECT * FROM EXTERNAL_QUERY("connection-id", "SELECT * FROM INFORMATION_SCHEMA.TABLES;");
But I want to query the tables. So I try:
SELECT * FROM EXTERNAL_QUERY("connection-id", "SELECT * FROM my_postgres_table;");
Then the console shows me this:
PostgreSQL type in column type is not supported in BigQuery. You can cast it to a supported type by PostgreSQL CAST() function. at [1:15]
How do I write this query to get table results back?
Thanks! 🙏
Upvotes: 0
Views: 1108
Reputation: 172994
If your external query contains a data type that is unsupported in BigQuery, the query will fail immediately. You can cast the unsupported data type to a different supported MySQL or PostgreSQL data type.
See more for Limitations and Data type mappings
Upvotes: 2