Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/refine_prompt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@

1. 技术准确性
- 保留所有技术术语、代码、命令、变量名、品牌名称的原始形式
- 专业术语首次出现可加英文注释(如"查询优化器(Query Optimizer)", "商业版 (Business)")
- 专业术语首次出现可加英文注释(如"查询优化器 (Query Optimizer)", "商业版 (Business)"

2. 语言优化
- 消除直译生硬感,符合中文技术文档习惯
- 使用中文标点符号(""、;)
- 调整长句结构使其更流畅

3. 格式保留
- 严格保持原始markdown结构(标题/表格/列表/代码块)
- 严格保持原始 markdown 结构(标题/表格/列表/代码块)
- JSON/YAML仅翻译明确可本地化的字段(如"title")
- 中文与英文&数字之间要有空格

4. 禁止行为
- 不添加任何说明性文字,比如修改说明、主要优化说明等注释性说明,最终文字直接可用
- 不调整文档原始结构
- 不修改非中文内容(数字/版本号/参数值)
- 文章的最后一定不能追加“修改说明”等注释性文字(务必记住禁止这个行为!)
- 整篇文章不需要被```markdown ```包裹,因为这样会导致文档无法正常显示。

5. 输出要求
- 直接输出最终文档内容
Expand Down
22 changes: 10 additions & 12 deletions docs/cn/guides/54-query/04-external-function.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
```markdown
---
title: "Databend Cloud 中的外部函数"
sidebar_label: "外部函数"
Expand All @@ -14,9 +13,9 @@ Databend 的外部函数允许您使用 Python 等编程语言编写的外部服

下表列出了在 Databend 中创建外部函数支持的语言及所需库:

| 语言 | 所需库 |
| ------ | -------------------------------------------------------- |
| Python | [databend-udf](https://pypi.org/project/databend-udf) |
| 语言 | 所需库 |
| ------ | ----------------------------------------------------- |
| Python | [databend-udf](https://pypi.org/project/databend-udf) |

## 管理外部函数

Expand Down Expand Up @@ -67,13 +66,13 @@ if __name__ == '__main__':

**`@udf` 装饰器参数说明:**

| 参数 | 描述 |
| ------------- | -------------------------------------------------------------------- |
| `input_types` | 输入数据类型列表(如 `["INT", "VARCHAR"]`) |
| `result_type` | 返回值类型(如 `"INT"`) |
| `name` | (可选)函数自定义名称,默认使用原函数名 |
| `io_threads` | I/O 密集型函数中每个数据块使用的 I/O 线程数 |
| `skip_null` | 设为 `True` 时跳过 NULL 值,返回值自动设为 NULL(默认 `False`) |
| 参数 | 描述 |
| ------------- | --------------------------------------------------------------- |
| `input_types` | 输入数据类型列表(如 `["INT", "VARCHAR"]`) |
| `result_type` | 返回值类型(如 `"INT"`) |
| `name` | (可选)函数自定义名称,默认使用原函数名 |
| `io_threads` | I/O 密集型函数中每个数据块使用的 I/O 线程数 |
| `skip_null` | 设为 `True` 时跳过 NULL 值,返回值自动设为 NULL(默认 `False`) |

**Databend 与 Python 数据类型映射:**

Expand Down Expand Up @@ -216,4 +215,3 @@ CREATE FUNCTION gcd (INT, INT)
## 结论

Databend Cloud 的外部函数通过集成 Python 等语言的自定义代码,为数据处理管道提供了强大的扩展能力。遵循上述步骤可创建处理复杂任务、利用外部库并实现高级逻辑的外部函数。
```
Loading