Title: 544
Tags: lec38

Q: What are some examples of external tables we can register in BigQuery?
A: Parquet files in GCS, Google sheets, etc.

Q: If column C is an array type, how do you get the Nth item from every array using BigQuery?
A: SELECT C[OFFSET(N)]
FROM some_table

Q: What can we call if we want to get a pandas DataFrame from a BigQuery query?  What about a geopandas GeoDataFrame?
bq.query(...).?????()
A: to_dataframe
to_geodataframe

Q: Say you have a query like this:
SELECT * FROM myproj.mydataset.tbl1 WHERE x=3
And you want to put the results in a new BigQuery table named myproj.mydataset.tbl2
How do you do this?
A: CREATE OR REPLACE TABLE `myproj.mydataset.tbl2`
AS
SELECT * FROM myproj.mydataset.tbl1 WHERE x=3

Q: What is the difference between ST_CENTROID_AGG(geo_column) and ST_CENTROID(geo_column)?
A: ST_CENTROID_AGG will give a single centroid for the shape representing the union of every shape in geo_column.
ST_CENTROID will give many centroids, one for each shape in a cell of geo_column.

Q: If you have floats long and lat, what can you call in BigQuery to convert this to a geographic point that can be used with other spatial functions?
A: ST_GEOGPOINT(long, lat)