Repository navigation
Add supports_nulls_first_in_sort to Dialect - #1284
phillipleblanc wants to merge 1 commit into
Conversation
|
Thanks @phillipleblanc -- looks good to me One thing I thought of while looking at this PR was that it is on the borderline between syntax and semantics as explained in However, since the syntax is rejected by MySQL perhaps it is ok to not parse the syntax in this crate too (though this crate is definitely not consistent in this regard) 🤔 |
That is a good callout - I did not see that previously.
I do think we should allow parsing of it then, as this is more of a semantic issue (since NULLS FIRST is really part of the SQL standard - MySQL why are you different! shakes fist) I will close this PR then. |
The MySQL dialect doesn't support parsing the
NULLS FIRST/LASTclause inORDER BYexpressions. This PR adds asupports_nulls_first_in_sortfunction to theDialecttrait (which is also a requirement in DataFusion for unparsing using the MySQL dialect, see apache/datafusion#10625). Using this, we now validate that SQL statements that were previously usingNULLS FIRST/LASTwill fail properly when parsed with the MySQL syntax.This is the error I get from MySQL when trying to use
NULLS FIRSTin a query:Query 1 ERROR at Line 3: : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'nulls first limit 10' at line 3