apache / apache/datafusion-python

Expose SessionContext.add_analyzer_rule for Python-defined analyzer rules

Đang mở
#1,575 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
604
Fork
174
Merge trung bình
1 ngày 7 giờ
Pull request đã merge (30 ngày)
4

Mô tả

## Background

`SessionContext::add_analyzer_rule` registers an `Arc` that runs during plan analysis (the pre-optimization pass that resolves names, applies type coercion, etc.). The Python bindings do not expose this method.

## Upstream signature

```rust
pub fn add_analyzer_rule(&self, analyzer_rule: Arc)
```

## User value

Lets users intercept and transform a logical plan immediately after analysis, before the main optimizer runs. Useful for custom semantic validation, injecting domain-specific defaults, or rewriting unresolved references against an external catalog.

## Why deferred

Blocked upstream, same root cause as #1574 ([add_optimizer_rule](https://github.com/apache/datafusion-python/issues/1574)): no FFI bridge exists for the logical `AnalyzerRule` trait, and a Python-only adapter can observe but not meaningfully transform `LogicalPlan` nodes because there are no Python constructors for the variants. Tracked here; revisit when upstream lands an `FFI_AnalyzerRule`.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.