External Function
External Function is Lakehouse's remote custom function. It allows calling Python or Java code deployed on cloud function services (Alibaba Cloud FC, Tencent Cloud SCF) within SQL queries, handling complex logic that Lakehouse built-in functions cannot complete.
Comparison with SQL Function
| Aspect | SQL Function | External Function |
|---|---|---|
| Implementation Language | SQL expressions | Python / Java |
| Execution Location | Inside Lakehouse engine | Remote function compute service |
| Applicable Scenarios | Simple calculations, format conversions | Complex algorithms, AI inference, calling external APIs |
| Dependency Configuration | None | Requires API Connection |
Usage Workflow
Create Example
Typical Use Cases
- Call AI models for text classification, sentiment analysis, image recognition
- Complex encryption/decryption logic
- Call external APIs to fetch real-time data (exchange rates, weather, etc.)
Related Documents
- External Function Details
- API Connection — configure function compute service authentication
- Custom Function Overview
