मुख्य सामग्री पर जाएँ
Skillpedia
API और सर्वर (backend)22k · #10231

bigquery-udfs

यह क्या करती है

यह स्किल तब BigQuery के लिए कस्टम फ़ंक्शन लिखने में मदद करती है जब बिल्ट-इन फ़ंक्शन काफ़ी न हों। यह उन डेवलपर्स के लिए है जिन्हें क्वेरी के अंदर खास लॉजिक या बाहरी सेवाओं को कॉल करना है।

कब इस्तेमाल करें

  • ✓जब आप SQL, JavaScript या Python में BigQuery के लिए कस्टम फ़ंक्शन लिखना चाहें।
  • ✓जब BigQuery में Python या JavaScript फ़ंक्शन को PyPI पैकेज या Cloud Storage लाइब्रेरी चाहिए।
  • ✓जब आप चाहते हों कि BigQuery क्वेरी remote function के ज़रिए किसी बाहरी API या Cloud Run सेवा को कॉल करे।

Skill का लिंक

https://github.com/google/skills/blob/main/skills/cloud/bigquery-udfs/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/google/skills/blob/main/skills/cloud/bigquery-udfs/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“BigQuery का ऐसा फ़ंक्शन लिखिए जो हर पंक्ति के लिए एक बाहरी API कॉल करे और नतीजा लौटाए।”

हर हफ़्ते 5 नई skills, 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):

  1. Install and Authenticate Google Cloud SDK: Install the Google Cloud SDK and authenticate:

    gcloud auth login
    

    Pass --project={project_id} and --region={region} (or --location for bq) explicitly on each command instead of running gcloud config set, which persists beyond the task. Default to us-central1 when the user has not specified a region (see BigQuery Locations).

  2. 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 (and run.googleapis.com for Remote Functions)
    CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:bigquery-udfs)" \
    gcloud services enable bigquery.googleapis.com \
      bigqueryconne
    
अक्सर पूछे जाने वाले सवाल

मुझे कौन सा फ़ंक्शन प्रकार चुनना चाहिए?

SQL फ़ंक्शन डिफ़ॉल्ट हैं, क्योंकि वे सबसे तेज़ चलते हैं। बाहरी विकल्प तब हैं जब SQL काफ़ी न हो।

क्या Python फ़ंक्शन Google Cloud APIs को कॉल कर सकता है?

हाँ। connection इस्तेमाल करने पर Python फ़ंक्शन Google Cloud और बाहरी APIs को कॉल कर सकता है।

remote function क्या है?

यह ऐसा फ़ंक्शन है जो आपके अपने endpoint पर चलता है, 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
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

finding-google-skills

22k

आपके एजेंट को किसी सेटअप काम के लिए सही Google गाइड खोजने में मदद करती है, जैसे hosting, databases, storage, sign-in या AI model serving।

AI और एजेंटएजेंट

gcloud

22k

यह आपके एजेंट को Google Cloud gcloud कमांड लिखने और जाँचने में मदद करती है, कुछ भी चलाने से पहले सटीक सिंटैक्स देखकर, ताकि फ़्लैग का अंदाज़ा न लगे।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

google-cloud-recipe-auth

22k

आपके एजेंट को Google Cloud की पहचान और पहुँच समझाती है, जिसमें यह शामिल है कि लोग और सेवाएँ कैसे साइन इन करते हैं और उन्हें कौन सी अनुमतियाँ मिलती हैं।

कोडिंगसिक्योरिटी

google-cloud-recipe-onboarding

22k

एक नए डेवलपर को Google Cloud पर पहले कदमों में मदद करती है, जिसमें प्रोजेक्ट चुनना, बिलिंग जोड़ना और पहला संसाधन डिप्लॉय करना शामिल है।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

मिलती-जुलती skills