Skip to content

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

Closed

Description

@goldmedal

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

Activity

  1. goldmedal commented on May 24, 2024

    @goldmedal
    ContributorAuthor

    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

  2. alamb commented on May 25, 2024

    @alamb
    Contributor

    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

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