apache / apache/datafusion-python

Expose SessionContext.add_analyzer_rule for Python-defined analyzer rules

Ouverte
#1,575 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
604
Forks
174
Merge moyen
2 j 22 h
PR mergées (30 j)
5

Description

## 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`.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Commencez par examiner SessionContext::add_analyzer_rule, l’issue #1574 et le travail upstream pour un bridge FFI_AnalyzerRule. La tâche sera prête lorsque les bindings Python pourront exposer des règles d’analyse qui transforment de manière significative les plans logiques, y compris le support requis de LogicalPlan.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python, rust
Domaine
api, backend-api-design
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.