Expose SessionContext.register_higher_order_function / deregister_higher_order_function (v54)
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
先閱讀 PR #1561,以及針對 HigherOrderFunctionImpl 和 Expr 的上游 SessionContext 註冊簽章。定義用於註冊和取消註冊自訂高階函式的 Python API,包括 invoke 如何回傳一個 Expr;完成標準是 v54 註冊介面已公開並可供函式庫作者使用。
由索引模型根據 Issue 內容生成。
描述
Background
DataFusion 54 introduced first-class higher-order functions (HOFs) that take lambdas plus collection arguments and rewrite to a scalar Expr at planning time. PR #1561 exposed Python lambda syntax and the built-in HOFs (array_transform, array_filter, array_any_match, etc.) but did not expose the registration API for custom HOFs.
Upstream signature
pub fn register_higher_order_function(&self, func: Arc<dyn HigherOrderFunctionImpl>)
pub fn deregister_higher_order_function(&self, name: &str) -> Option<Arc<dyn HigherOrderFunctionImpl>>
HigherOrderFunctionImpl trait requires name(), args_count() (min, max), and invoke(&self, args: &[Expr]) -> Result<Expr>.
User value
Lets library authors add lambda-aware operators that are not in DataFusion's built-in set. Examples: array_window(arr, size, x -> ...), array_partition_by(arr, x -> key(x)), array_zip_with(a, b, (x, y) -> x * y), or domain-specific operators on JSON / graph / geo arrays. The HOF runs at logical-plan time, rewriting lambda + args into a standard Expr tree the planner optimizes -- not equivalent to a ScalarUDF.
Why deferred
Effort estimate is medium-large (~350-550 LOC) and the authoring cost is high for end users: the invoke callback must return a DataFusion Expr tree from Python, which requires familiarity with the Expr grammar. Most array-lambda needs are already covered by the built-in HOFs PR #1561 ships. No open user requests at the time of audit. Filed for tracking to complete the v54 HOF surface symmetrically once a concrete use case or extension-library ecosystem emerges.
- 主要語言
- Python
- 星號
- 606
- 分支
- 176
- 平均合併
- 1 天 7 小時
- 30 天內合併 PR
- 14
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
apache/datafusion-python 的其他 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 75/100
apache/datafusion-python#1765 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
apache/datafusion-python#1760 ·
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 70/100
apache/datafusion-python#1757 ·
維護者通常 1 天內回覆
-
documentation
難度 2/5 1-3 小時 新手友好度 72/100
apache/datafusion-python#1726 ·
維護者通常 1 天內回覆
-
難度 2/5 半天 新手友好度 88/100
apache/datafusion-python#1691 ·
維護者通常 1 天內回覆
查看 apache/datafusion-python 的全部 Issue
相似的 Issue
-
upstream update
難度 2/5 1-3 小時 新手友好度 75/100
conan-io/conan-center-index#31098 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
john-kurkowski/tldextract#382 ·
-
comp/tools duplicate P2 sweeper:risk-compatibility tool/mcp type/bug
難度 1/5 1 小時以內 新手友好度 88/100
NousResearch/hermes-agent#132042 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
deepset-ai/haystack#13092 ·
維護者通常 1 天內回覆
-
難度 1/5 1-3 小時 新手友好度 85/100
feder-cr/invisible_playwright_mcp#1408 ·
維護者通常 1 天內回覆