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). |
|
Concatenates one or more arrays with the same element type into a single array. |
|
Takes an array and returns the first element in the array. |
|
Returns a prefix of input_array consisting of the first n elements. |
|
Takes an array and returns TRUE if there is an element in the array that is equal to the search_value. |
|
Takes an array to search and an array of search values. |
|
Takes an array to search and an array of search values. |
|
Returns TRUE if the array contains no repeated elements, using the same equality comparison logic as SELECT DISTINCT. |
|
Takes an array and returns the last element in the array. |
|
Compute the length of each array element in the Series. |
|
Returns the input ARRAY with elements in reverse order. |
|
Returns an array containing zero or more consecutive elements from the input array. |
|
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. |
|
Uses the matching key from keyset to decrypt ciphertext and verifies the integrity of the data using additional_data. |
|
Like DETERMINISTIC_DECRYPT_BYTES, but where plaintext is of type STRING. |
|
Encrypts plaintext using the primary cryptographic key in keyset using deterministic AEAD. |
|
Takes an array of nested data and flattens a specific part of it into a single, flat array with the [array elements field access operator][array-el-field-operator]. |
|
Returns an array of values. |
|
Specifies the set of discrete values for the hyperparameter. |
|
Defines the minimum and maximum bounds of the search space of continuous values for a hyperparameter. |
|
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. |