(&self, stmt: DropFunction)
| 1506 | } |
| 1507 | |
| 1508 | async fn drop_function(&self, stmt: DropFunction) -> Result<DataFrame> { |
| 1509 | // we don't know function type at this point |
| 1510 | // decision has been made to drop all functions |
| 1511 | let mut dropped = false; |
| 1512 | dropped |= self.state.write().deregister_udf(&stmt.name)?.is_some(); |
| 1513 | dropped |= self.state.write().deregister_udaf(&stmt.name)?.is_some(); |
| 1514 | dropped |= self.state.write().deregister_udwf(&stmt.name)?.is_some(); |
| 1515 | dropped |= self.state.write().deregister_udtf(&stmt.name)?.is_some(); |
| 1516 | dropped |= self |
| 1517 | .state |
| 1518 | .write() |
| 1519 | .deregister_higher_order_function(&stmt.name)? |
| 1520 | .is_some(); |
| 1521 | |
| 1522 | // DROP FUNCTION IF EXISTS drops the specified function only if that |
| 1523 | // function exists and in this way, it avoids error. While the DROP FUNCTION |
| 1524 | // statement also performs the same function, it throws an |
| 1525 | // error if the function does not exist. |
| 1526 | |
| 1527 | if !stmt.if_exists && !dropped { |
| 1528 | exec_err!("Function does not exist") |
| 1529 | } else { |
| 1530 | self.return_empty_dataframe() |
| 1531 | } |
| 1532 | } |
| 1533 | |
| 1534 | fn execute_prepared(&self, execute: Execute) -> Result<DataFrame> { |
| 1535 | let Execute { |
no test coverage detected