BigQuery Python UDFs Now GA: Run NumPy, Pandas, and More Directly in SQL

SQL remains the standard for structured data analysis, but complex procedural logic, scientific computation, string manipulation, and ML workflows are notoriously awkward to express in pure SQL. Data practitioners have traditionally had to spin up separate infrastructure — containers, custom images, additional compute services — just to run simple helper functions with Python libraries. This article announces the general availability of BigQuery Managed Python UDFs, which aim to close that gap by letting users execute custom Python code directly inside BigQuery using standard SQL queries or BigFrames, without managing any underlying infrastructure.

The concrete path is straightforward: BigQuery handles compilation, image building, security patching, deployment, and execution automatically on serverless, auto-scaling resources. The release supports key libraries like NumPy, SciPy, pandas, and scikit-learn, and enables real-time calls to external APIs or Google Cloud services such as Cloud Translation and Gemini Enterprise Agent Platform. Advanced capabilities include vectorized processing via PyArrow RecordBatches (which can boost performance up to 10x for data-intensive calculations), configurable container memory up to 16 GB and CPU up to 4 vCPUs, customizable concurrency up to 1,000 concurrent operations per container, and streaming logs plus real-time CPU/memory metrics in Cloud Monitoring.

The takeaway for serious builders is that this removes a significant operational burden for teams that need Python logic embedded in their data warehouse workflows. Instead of managing separate compute clusters or containers for helper functions, you can now define a Python UDF, call it in a SQL query, and get BQ-managed scaling, security patching, and cost observability via INFORMATION_SCHEMA.JOBS and billing labels. The billing is under the standard BigQuery Services SKU and eligible for committed-use discounts. If you’ve been stitching together multiple services just to run a tokenizer or a HTML parser on table data, this is worth a close look.

Python UDF in BigQuery, now generally available

View Original