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

Support convert LogicalPlan JOIN with Using constraint to SQL String #10652

Closed
Tracked by #8661
goldmedal opened this issue May 24, 2024 · 2 comments · Fixed by #11636
Closed
Tracked by #8661

Support convert LogicalPlan JOIN with Using constraint to SQL String #10652

goldmedal opened this issue May 24, 2024 · 2 comments · Fixed by #11636
Labels
enhancement New feature or request

Comments

@goldmedal
Copy link
Contributor

Is your feature request related to a problem or challenge?

We only support to convert JOIN with ON constraint to SQL String now. The SQL as below can't be converted now.

SELECT * FROM orders JOIN customer USING (custkey)

It will panic with the message:

NotImplemented("Unsupported join constraint: Using")

Describe the solution you'd like

The unparse rule for JOIN in datafusion/sql/src/unparser/plan.rs should be implemented.

LogicalPlan::Join(join) => {
match join.join_constraint {
JoinConstraint::On => {}
JoinConstraint::Using => {
return not_impl_err!(
"Unsupported join constraint: {:?}",
join.join_constraint
)
}

Describe alternatives you've considered

No response

Additional context

No response

@goldmedal goldmedal added the enhancement New feature or request label May 24, 2024
@goldmedal
Copy link
Contributor Author

goldmedal commented May 24, 2024

By the way, I saw there're other unimplemented plans in plan.rs:

  • Distinct
  • Window
  • Extension (I guess we need to provide some method for UserDefinedLogicalNodeCore)

Is there any plan to support them?
gentle ping @alamb

@alamb
Copy link
Contributor

alamb commented May 25, 2024

Is there any plan to support them?

I think we should make plans to support them!

I started collecting issues on #8661

I also filed
#10663
#10664

to track distint and window

Looking at

LogicalPlan::Explain(_)
| LogicalPlan::Analyze(_)
| LogicalPlan::Extension(_)
| LogicalPlan::Prepare(_)
| LogicalPlan::Ddl(_)
| LogicalPlan::Copy(_)
| LogicalPlan::DescribeTable(_)
| LogicalPlan::RecursiveQuery(_)
| LogicalPlan::Unnest(_) => not_impl_err!("Unsupported plan: {plan:?}"),
it actually looks like there are seveal other types of plans not yet supported (like EXPLAIN, INSERT, etc...) Maybe we should file tickets for them as well

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

Successfully merging a pull request may close this issue.

2 participants