cloud-fan opened a new pull request, #53835:
URL: https://github.com/apache/spark/pull/53835

   ### What changes were proposed in this pull request?
   
   This PR fixes a regression introduced by SPARK-54866 (PR #53638) where `DROP 
FUNCTION IF EXISTS` would fail when the namespace doesn't exist.
   
   Previously, when dropping a function in a non-existing namespace with `IF 
EXISTS`, the `UnresolvedFunctionName` would remain unchanged because 
`CatalogV2Util.loadFunction` returns None. Later, the drop function command was 
converted to `NoopCommand`, which gracefully handles the case.
   
   After PR #53638, the drop function command directly calls 
`SessionCatalog.dropFunction`, which calls `requireDbExists` and throws an 
exception when the namespace doesn't exist, even with `IF EXISTS` specified.
   
   ### Why are the changes needed?
   
   To fix a regression where `DROP FUNCTION IF EXISTS` fails on non-existing 
namespace instead of gracefully doing nothing.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, it fixes a regression. `DROP FUNCTION IF EXISTS db.func` no longer 
throws an error when `db` doesn't exist.
   
   ### How was this patch tested?
   
   Added a new test in `DataSourceV2FunctionSuite`.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: cursor


-- 
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]

Reply via email to