apache / apache/datafusion-python

Expose SessionContext.add_analyzer_rule for Python-defined analyzer rules

Abierto
#1,575 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
604
Forks
174
Merge medio
1 d 7 h
PR fusionados (30 d)
4

Descripción

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Start by reviewing SessionContext::add_analyzer_rule, issue #1574, and the upstream work for an FFI_AnalyzerRule bridge. The task is ready when Python bindings can expose analyzer rules that meaningfully transform logical plans, including the required LogicalPlan support.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python, rust
Área
api, backend-api-design
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.