Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

BigQuery Federated Query camel-case not working

Hello,

I have following table in Cloud SQL (PosgresSQL):

my_postgresql_table:

  • column_a
  • columnB
  • column_c
  • columnD

I'm trying to query the table through BigQuery Federated Queries.

When I query snake-case columns only the query works fine:

SELECT * FROM EXTERNAL_QUERY("my-conection-id", "select column_a, column_c from my_postgresql_table");
 
But it fails when I query camel-case columns:
SELECT * FROM EXTERNAL_QUERY("my-conection-id", "select columnB, columnD from my_postgresql_table");

Error:

Invalid table-valued function EXTERNAL_QUERY Failed to get query schema from PostgreSQL server, prepare statement failed. Error: ERROR: column "columnB" does not exist LINE 1
 
 
Please advise.
Thanks.




Solved Solved
0 2 822
1 ACCEPTED SOLUTION

This is more of a PostgreSQL case-sensitivity issue than Bigquery. I have found some similar issues in stackoverflow and stackexchange. You may refer to these rules of identifier naming if you still choose to use camel-case for your naming convention as compared to prevalent convention using upper case and lower case with underscores. 

View solution in original post

2 REPLIES 2