bigquery-udfs
하는 일
이 스킬은 기본 함수로 부족할 때 BigQuery용 사용자 정의 함수를 작성하도록 돕습니다. 쿼리 안에서 특별한 로직이나 외부 서비스 호출이 필요한 개발자를 위한 스킬입니다.
사용하는 경우
- ✓SQL, JavaScript 또는 Python으로 BigQuery 사용자 정의 함수를 작성하고 싶을 때.
- ✓BigQuery의 Python 또는 JavaScript 함수에 PyPI 패키지나 Cloud Storage 라이브러리가 필요할 때.
- ✓BigQuery 쿼리가 원격 함수를 통해 외부 API나 Cloud Run 서비스를 호출하게 하고 싶을 때.
스킬 링크
https://github.com/google/skills/blob/main/skills/cloud/bigquery-udfs/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“각 행마다 외부 API를 호출하고 결과를 돌려주는 BigQuery 함수를 작성해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
작업에 맞는 가장 가벼운 함수 유형을 고른 다음 함수를 작성하고 배포합니다. 함수가 실패하면 문제 해결도 도와줍니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
BigQuery User-Defined Functions (UDFs)
BigQuery User-Defined Functions (UDFs) extend GoogleSQL with custom logic
written in SQL, JavaScript, managed Python (python-3.11), or hosted externally
as Remote Functions on Cloud Run and Cloud Run functions.
Usage Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read and follow the instructions in
Usage Attribution.
Choosing the Right UDF Type
Always select the lightest-weight runtime that satisfies the requirement, because BigQuery optimizes native SQL expressions inline while external runtimes incur serialization and container startup overhead:
| UDF Type | Connection Required? | When to Use | Key Constraints |
|---|---|---|---|
| SQL UDF (Default) | No | Composable expressions, regex, struct/array manipulation, aggregate functions (CREATE AGGREGATE FUNCTION), or polymorphic ANY TYPE parameters. |
Lowest latency; zero external dependencies; supports TEMP or persistent functions. |
| JavaScript UDF | No | Custom string/JSON logic or bundling .js libraries from Cloud Storage (gs://). |
Runs in V8 sandbox; INT64 unsupported as input (pass as FLOAT64 or STRING). Max 32 KB inline code, 1 MB per external resource. Supports TEMP or persistent functions. |
| Managed Python UDF (Offline) | No | Pure compute using Python 3.11, PyPI wheels (packages=[...]), Cloud Storage .py modules (library=[...]), or vectorized Pandas/PyArrow batches. |
Persistent functions only (CREATE TEMP FUNCTION unsupported). Outbound network blocked. Max container size: 4 vCPU / 16 GiB. JSON, RANGE, INTERVAL, GEOGRAPHY unsupported. |
Managed Python UDF (WITH CONNECTION) |
Yes (CLOUD_RESOURCE) |
Invoking Google Cloud APIs (e.g., Cloud Translation, Gemini Enterprise Agent Platform) or online HTTP endpoints directly from Python inside BigQuery containers. | Requires WITH CONNECTION. Outbound traffic restricted to restricted.googleapis.com in VPC-SC perimeters (VPC networks unsupported). Max container size: 4 vCPU / 16 GiB. |
Remote Function (REMOTE WITH CONNECTION) |
Yes (CLOUD_RESOURCE) |
Calling external APIs or microservices when you need non-Python runtimes (Go, Java, Node.js), private VPC network access, GPUs, or custom Cloud Run scaling. | Requires Cloud Run HTTPS endpoint implementing BigQuery JSON batch contract and roles/run.invoker. Max input 5 MB per row; response limit 15 MB (Cloud Run) / 10 MB (1st gen). |
Prerequisites & Setup
Ensure the Google Cloud project has an active billing account attached (see BigQuery Pricing):
Install and Authenticate Google Cloud SDK: Install the Google Cloud SDK and authenticate:
gcloud auth loginPass
--project={project_id}and--region={region}(or--locationforbq) explicitly on each command instead of runninggcloud config set, which persists beyond the task. Default tous-central1when the user has not specified a region (see BigQuery Locations).Enable Required APIs:
- For SQL, JavaScript, and offline Python UDFs:
bigquery.googleapis.com - Additionally for Python UDFs calling APIs (
WITH CONNECTION) and Remote Functions:bigqueryconnection.googleapis.com(andrun.googleapis.comfor Remote Functions)
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:bigquery-udfs)" \ gcloud services enable bigquery.googleapis.com \ bigqueryconne- For SQL, JavaScript, and offline Python UDFs:
자주 묻는 질문
어떤 종류의 함수를 골라야 하나요?
SQL 함수가 가장 빠르므로 기본으로 쓰는 것이 좋습니다. 외부 옵션은 SQL로 충분하지 않을 때 씁니다.
Python 함수가 Google Cloud API를 호출할 수 있나요?
네. 연결(connection)을 사용하면 Python 함수가 Google Cloud와 외부 API를 호출할 수 있습니다.
원격 함수란 무엇인가요?
Cloud Run 또는 Cloud Run functions에서 자신의 엔드포인트로 실행되며, BigQuery가 호출하는 함수입니다.
상세 정보
작성자의 원본 설명
Creates, deploys, and troubleshoots BigQuery User-Defined Functions (UDFs) and Remote Functions across SQL, JavaScript, Python, and Cloud Run endpoints. Use when writing custom scalar or aggregate functions in BigQuery, installing PyPI packages or Cloud Storage libraries in a Python or JavaScript UDF, or calling Google Cloud and external APIs from a Python UDF (WITH CONNECTION) or Remote Function. Don't use for standard BigQuery table/dataset CRUD (use bigquery-basics), DataFrames client workflows (use bigquery-bigframes), or BigQuery ML models (use bigquery-ai-ml).
repo: google/skills
인기도
- GitHub 스타
- 22k
- 순위
- #10231
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
finding-google-skills
22k에이전트가 호스팅, 데이터베이스, 저장소, 로그인, AI 모델 제공처럼 설정 작업에 맞는 Google 가이드를 찾도록 돕습니다.
gcloud
22k에이전트가 Google Cloud gcloud 명령을 작성하고 확인하도록 돕습니다. 플래그를 추측하지 않도록 무엇이든 실행하기 전에 정확한 문법을 확인합니다.
google-cloud-recipe-auth
22k에이전트가 Google Cloud의 신원과 접근 권한을 안내합니다. 사람과 서비스가 어떻게 로그인하고 어떤 권한을 받는지 포함합니다.
google-cloud-recipe-onboarding
22k새 개발자가 Google Cloud에서 프로젝트 선택, 결제 연결, 첫 리소스 배포 같은 첫 단계를 밟도록 안내합니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.