apache / apache/datafusion-python

Expose SessionContext.add_analyzer_rule for Python-defined analyzer rules

Aberta
#1,575 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
604
Forks
174
Merge médio
1d 7h
PRs com merge (30d)
4

Descrição

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

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Comece revisando SessionContext::add_analyzer_rule, a issue #1574 e o trabalho upstream para uma bridge FFI_AnalyzerRule. A tarefa estará pronta quando os bindings Python puderem expor regras de análise que transformem planos lógicos de forma significativa, incluindo o suporte necessário a LogicalPlan.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python, rust
Domínio
api, backend-api-design
Tipo de issue
Funcionalidade
Dificuldade
5/5
Tempo estimado
Mais de uma semana
Status de atividade
Pouca atividade
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.