Bigquery: can't change name
We are changing the naming convention in UpperCamelCase. Then we realized that if it is a one-word name, BQ will simply ignore changes in any case. For example, when we ran the following query, all the field names changed as we expected, except that "speed", "ignition", "latitude" and "longitude" remained the same as in lowercase ... Interesting, is it a bug or a special consideration? This gave us a huge problem when we were migrating our big data into thousands of tables to the new naming convention
SELECT
file_date_time AS FileLastModifiedTime
,driver_id AS DriverId
,date_time AS DateTime
,latitude AS Latitude
,longitude AS Longitude
,gps_valid AS GpsValid
,ignition AS Ignition
,speed AS SPEED
,gps_reason AS GpsReason
,zip_code AS ZipCode
FROM MyTable
source to share
This is mistake. Field names in BigQuery are not case sensitive, and you should be able to change the case of a field using aliases. I internally filed an error.
A workaround is to do a no-op typecast, which will force us to apply an exact corpus alias.
For example, if the speed is int:SELECT ... INTEGER(speed) AS SPEED, ...
source to share