Skip to content

ANTI join without LEFT/RIGHT creates an invalid AST. #1504

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

Closed
universalmind303 opened this issue Nov 7, 2024 · 0 comments · Fixed by #1528
Closed

ANTI join without LEFT/RIGHT creates an invalid AST. #1504

universalmind303 opened this issue Nov 7, 2024 · 0 comments · Fixed by #1528

Comments

@universalmind303
Copy link
Contributor

if you try to do a ANTI JOIN without <LEFT|RIGHT> ANTI, it treats ANTI as an alias for the table instead of an anti join

example query. This works fine in duckdb.

        SELECT * from table1
        ANTI JOIN table2 t2 on t1.id = t2.id 

Full Example.

use sqlparser::dialect::GenericDialect;
use sqlparser::parser::Parser;

fn main() {
    let sql = r#"
        SELECT * from table1
        ANTI JOIN table2 t2 on t1.id = t2.id 
        "#;

    let dialect = GenericDialect {};

    let ast = Parser::parse_sql(&dialect, sql).unwrap();

    println!("AST: {:?}", ast);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant