Skip to content

Add example for writing an SQL analysis pass #10871

@alamb

Description

@alamb

Is your feature request related to a problem or challenge?

We have many good examples in https://github.com/apache/datafusion/tree/3773fb7fb54419f889e7d18b73e9eb48069eb08e/datafusion-examples

However, we don't have anexample for writing some sort of SQL analysis -- for example what @LorrensP-2158466 mentions about finding cyclic joins in #10808 (comment).

However, I know of several users of DataFusion doing this (e.g. @sadboy and SDF)

Describe the solution you'd like

The ideal example I think would be to add a file to https://github.com/apache/datafusion/tree/3773fb7fb54419f889e7d18b73e9eb48069eb08e/datafusion-examples

sql_analysis.rs

Perhaps the example could show how to create LogicalPlans for several sql query texts, and then use DataFusion structures to do an analysis (like maybe join counts, or predicate analysis or something) would be really neat.

I think this would be very valuable

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions