apache / datafusion-sqlparser-rs

Extensible SQL Lexer and Parser for Rust
Apache License 2.0
2.81k stars 543 forks source link

feat: Support IGNORE NULLS only for allowed aggregation functions #1206

Open comphead opened 7 months ago

comphead commented 7 months ago

Currently parser allows to parse queries which IMHO should be failing by unsupported syntax. Like SELECT COUNT(*) IGNORE NULLS FROM (values (1), (null), (2));

The allowed list for IGNORE NULLS can be found https://github.com/ronsavage/SQL/blob/master/sql-2016.ebnf

alamb commented 7 months ago

In general I think this crate focuses on parsing the syntax and leaves it to downstream crates (like datafusion) to enforce whatever semantics they want

This is written up a bit here: https://github.com/sqlparser-rs/sqlparser-rs?tab=readme-ov-file#syntax-vs-semantics