# docs/source/working-notes/troyraen/bigquery.md ## BigQuery Links ```python query = """ CREATE VIEW `avid-heading-329016.ztf_alerts.DIASource` (objectId, candid, jd, fid) PARTITION BY CAST(jd, INT64) SET OPTIONS (enable_refresh=false) CLUSTER BY objectId AS SELECT objectId, candidate.candid AS candid, candidate.jd AS jd, candidate.fid AS fid FROM `ardent-cycling-243415.ztf_alerts.alerts` UNION DISTINCT SELECT objectId, prvcand.candid AS candid, prvcand.jd AS jd, prvcand.fid AS fid FROM `ardent-cycling-243415.ztf_alerts.alerts`, UNNEST(prv_candidates) prvcand """ ``` - [Python Client for Google BigQuery](https://googleapis.dev/python/bigquery/latest/index.html) - https://stackoverflow.com/questions/50885946/python-bigquery-api-get-table-schema/50908479 - https://cloud.google.com/bigquery/docs/information-schema-tables#columns_view - https://googleapis.dev/python/bigquery/latest/usage/queries.html - https://cloud.google.com/bigquery/docs/bigquery-storage-python-pandas#download_query_results_using_the_client_library - https://beam.apache.org/releases/pydoc/2.28.0/apache_beam.io.gcp.bigquery.html - https://beam.apache.org/documentation/io/built-in/google-bigquery/#reading-with-a-query-string - https://www.tutorialspoint.com/sql/sql-distinct-keyword.htm - https://cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_functions#avg - https://cloud.google.com/bigquery/docs/best-practices-performance-input - https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types?hl=pl - . - https://alerce-new-python-client.readthedocs.io/en/main/tutorials/ztf_api.html#query-lightcurve - https://noao.gitlab.io/antares/client/tutorial/searching.html - . - https://learn.astropy.org/rst-tutorials/conesearch.html?highlight=filtertutorials - https://docs.astropy.org/en/stable/coordinates/ - [Pipelining Generators](https://www.programiz.com/python-programming/generator#:~:text=at%20a%20time).-,Create%20Generators%20in%20Python,it%20becomes%20a%20generator%20function.)