bigframes.bigquery#
Access BigQuery-specific operations and namespaces within BigQuery DataFrames.
This module provides specialized functions and sub-modules that expose BigQuery’s advanced capabilities to DataFrames and Series. It acts as a bridge between the pandas-compatible API and the full power of BigQuery SQL.
Key sub-modules include:
bigframes.bigquery.ai: Generative and predictive AI functions (Gemini, BQML).bigframes.bigquery.ml: Direct access to BigQuery ML model operations.bigframes.bigquery.obj: Support for BigQuery object tables.
This module also provides direct access to optimized BigQuery functions for:
JSON Processing: High-performance functions like
json_extract,json_value, andparse_jsonfor handling semi-structured data.Geospatial Analysis: Comprehensive geographic functions such as
st_area,st_distance, andst_centroid(ST_prefixed functions).Array Operations: Tools for working with BigQuery arrays, including
array_aggandarray_length.Vector Search: Integration with BigQuery’s vector search and indexing capabilities for high-dimensional data.
Custom SQL: The
sql_scalarfunction allows embedding raw SQL snippets for advanced operations not yet directly mapped in the API.
By using these functions, you can leverage BigQuery’s high-performance engine for domain-specific tasks while maintaining a Python-centric development experience.
For the full list of BigQuery standard SQL functions, see: https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-reference
Functions
|
Returns the approximate top elements of expression as an array of STRUCTs. |
|
Group data and create arrays from selected columns, omitting NULLs to avoid BigQuery errors (NULLs not allowed in arrays). |
|
Compute the length of each array element in the Series. |
|
Converts array elements within a Series into delimited strings. |
|
Creates a BigQuery external table. |
|
Creates a new vector index on a column of a table. |
|
Extracts a JSON value and converts it to a SQL JSON-formatted |
|
Extracts a JSON array and converts it to a SQL array of JSON-formatted STRING or JSON values. |
|
Extracts a JSON array and converts it to a SQL array of STRING values. |
|
Returns all keys in the root of a JSON object as an ARRAY of STRINGs. |
|
Extracts a JSON value and converts it to a SQL JSON-formatted |
|
Extracts a JSON array and converts it to a SQL array of JSON-formatted STRING or JSON values. |
|
Produces a new JSON value within a Series by inserting or replacing values at specified paths. |
|
Extracts a JSON scalar value and converts it to a SQL |
|
Extracts a JSON array of scalar values and converts it to a SQL |
|
Loads data into a BigQuery table. |
|
Converts a series with a JSON-formatted STRING value to a JSON value. |
|
Generates a pseudo-random value of type FLOAT64 in the range of [0, 1), inclusive of 0 and exclusive of 1. |
|
Create a Series from a SQL template. |
|
Returns the area in square meters covered by the polygons in the input GEOGRAPHY. |
|
Computes a GEOGRAPHY that represents all points whose distance from the input GEOGRAPHY is less than or equal to distance meters. |
|
Computes the geometric centroid of a GEOGRAPHY type. |
|
Computes the convex hull of a GEOGRAPHY type. |
|
Returns a GEOGRAPHY that represents the point set difference of geography_1 and geography_2. |
|
Returns the shortest distance in meters between two non-empty |
|
Returns a GEOGRAPHY that represents the point set intersection of the two input GEOGRAPHYs. |
|
Returns TRUE for a non-empty Geography, where each element in the Geography has an empty boundary. |
|
Returns the total length in meters of the lines in the input GEOGRAPHY. |
|
Returns statistics summarizing the pixel values of the raster image referenced by raster_id that intersect with geography. |
|
Returns a simplified version of the input geography. |
|
Takes a DataFrame and converts it into a Series of structs with each struct entry corresponding to a DataFrame row and each struct field corresponding to a DataFrame column |
|
Converts a series with a JSON value to a JSON-formatted STRING value. |
|
Converts a series to a JSON-formatted STRING value. |
|
Converts a timestmap series to unix epoch microseconds |
|
Converts a timestmap series to unix epoch milliseconds |
|
Converts a timestmap series to unix epoch seconds |
|
Conduct vector search which searches embeddings to find semantically similar entities. |