Closed vpetlu closed 4 years ago
FYI, I have a PR ready to address this already. We've signed a CLA, waiting for the OK from Google before I submit.
Thanks for reporting the issue @vpetlu, I'll take a look and report back.
Thanks. PR: https://github.com/firebase/extensions/pull/320
Hey @vpetlu, your observation is correct, the latitude and longitude values are placed incorrectly. However, I'm having trouble replicating it in my BigQuery table views (changelog and latest). Do you mind providing me with instructions on how to reproduce, please? Thank you!
Thanks for raising the issue @vpetlu I was finally able to see it in the changelog after I fixed another bug in the script. I've approved your PR even though I've also made the same change in my PR. I hope yours gets merged in before mine :)
[READ] Step 1: Are you in the right place?
Yes
[REQUIRED] Step 2: Describe your configuration
firestore-bigquery-export
[REQUIRED] Step 3: Describe the problem
When exporting geolocations from Firestore into BigQuery, the args are flipped causing lats and longs to be swapped.
ST_GEOGPOINT interface definition:
ST_GEOGPOINT(longitude, latitude)
firestoreGeopointDefinition code:
(ST_GEOGPOINT(SAFE_CAST(JSON_EXTRACT(json, '$._latitude') AS NUMERIC), SAFE_CAST(JSON_EXTRACT(json, '$._longitude') AS NUMERIC)))
Steps to reproduce:
Expected result
Actual result