We are changing filed naming convention to UpperCamelCase. Then we realized that if it's a single-word name, BQ just ignore any case changes. For example, when we ran the following query, all field names changed as we expected, except that 'speed', 'ignition','latitude' and 'longitude' just remained as they were in lower case.... I wonder if it's a bug or with special consideration? It gave us a huge issue when we are migrating our big data in thousands of tables into 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
This is a quirk in BQ's schema generation, for reasons mentioned in your other answer.
One workaround is to use a subselect that renames the fields to an intermediate name:
SELECT LatitudeTmp AS Latitude FROM
(SELECT latitude AS LatitudeTmp FROM MyTable)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With