Skip to content

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

@universalmind303

Description

@universalmind303

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions