Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suport unparsing LogicalPlan::Distinct to DISTINCT #10663

Closed
Tracked by #8661
alamb opened this issue May 25, 2024 · 1 comment · Fixed by #10690
Closed
Tracked by #8661

Suport unparsing LogicalPlan::Distinct to DISTINCT #10663

alamb opened this issue May 25, 2024 · 1 comment · Fixed by #10690
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@alamb
Copy link
Contributor

alamb commented May 25, 2024

Is your feature request related to a problem or challenge?

Part of #9726 to complete the LogialPlan --> SQL conversion

Converting LogicalPlan back to SQL is valuable for several usecases such as using DataFusion to programatically create SQL -- see the plan_to_sql.rs example

Describe the solution you'd like

Support converting SQL like this:

SELECT DISTINCT x FROM foo;

Describe alternatives you've considered

The basic pattern is this (see #10371 for an example):

  1. Implement the LogicalPlan --> AST reverse code in Unparser::plan_to_sql(source link)
  2. Add a test in roundtrip_statement in sql_integration.rs source link

Note you can run the tests like

cargo test -p datafusion-sql -- roundtrip_statement

Additional context

I think this is a good first issue as the pattern is well established and there are explicit instructions

@yyy1000
Copy link
Contributor

yyy1000 commented May 28, 2024

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants