Expose SessionContext.add_optimizer_rule for Python-defined logical optimizer rules
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
调研方向
首先,查看现有的 SessionContext.remove_optimizer_rule Python 绑定,以及 PR #1557 中 add_physical_optimizer_rule 的工作。待 upstream 提供 FFI_OptimizerRule 和 Python LogicalPlan 构造函数后,再重新处理此 issue;当 Python 定义的逻辑规则可以通过 add_optimizer_rule 注册并通过该绑定执行时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Background
SessionContext::add_optimizer_rule registers an Arc<dyn OptimizerRule> that runs during logical plan optimization. The Python bindings only expose remove_optimizer_rule, never the additive side. PR #1557 ultimately landed add_physical_optimizer_rule for the physical pipeline via FFI but did not address the logical pipeline.
Upstream signature
pub fn add_optimizer_rule(&self, optimizer_rule: Arc<dyn OptimizerRule + Send + Sync>)
User value
Lets users add domain-specific logical rewrites (predicate normalization, redundant join elimination, scan pruning informed by external metadata) without forking DataFusion. Complements the existing remove_optimizer_rule to round out the surface.
Why deferred
Blocked upstream. As documented in PR #1557, DataFusion does not currently expose an FFI bridge for the logical OptimizerRule / AnalyzerRule traits, and there are no Python constructors for LogicalPlan node variants -- a pure-Python rule could observe plans but not transform them. The PR #1557 commit history shows an initial attempt at a Python-defined logical rule that was abandoned for this reason. This is filed for tracking; it should be revisited once upstream lands an FFI_OptimizerRule (mirroring FFI_PhysicalOptimizerRule).
- 主要语言
- Python
- 星标
- 605
- 派生
- 176
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 8
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/datafusion-python 的其他 Issue
-
documentation
难度 2/5 1-3 小时 新手友好度 72/100
apache/datafusion-python#1726 ·
-
难度 2/5 半天 新手友好度 88/100
apache/datafusion-python#1691 ·
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
apache/datafusion-python#1644 ·
-
enhancement
难度 5/5 一周以上 新手友好度 30/100
apache/datafusion-python#1737 ·
-
难度 3/5 1-2 天 新手友好度 76/100
apache/datafusion-python#1735 · 1 条评论 ·
查看 apache/datafusion-python 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 90/100
learningequality/ricecooker#747 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 76/100
run-llama/llama_index#23199 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
KhronosGroup/glTF-Blender-IO#2769 ·