jackierwzhang opened a new pull request, #36252: URL: https://github.com/apache/spark/pull/36252
### What changes were proposed in this pull request? This PR introduces the following: - Parser changes to have an `IF EXISTS` syntax for `DROP COLUMN`. - Logic to silence the errors within parser and analyzer when encountering missing columns while using `IF EXISTS` - Ensure only resolving and dropping existing columns inside table schema ### Why are the changes needed? Currently `ALTER TABLE ... DROP COLUMN(s) ...` syntax will always throw error if the column doesn't exist. This PR would like to provide an (IF EXISTS) syntax to provide better user experience for downstream handlers (such as Delta with incoming column dropping support) that support it, and make consistent with some other DMLs such as `DROP TABLE (IF EXISTS)`. ### Does this PR introduce _any_ user-facing change? User may now specify `ALTER TABLE xxx DROP IF EXISTS COLUMN(S) a, a.b, c.d`. ### How was this patch tested? Modified existing unit tests and new unit tests. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
