Add unit test for parsing drop udf
@@ -37,6 +37,7 @@ use databend_query::sql::statements::DfDescribeTable;
use databend_query::sql::statements::DfDropDatabase;
use databend_query::sql::statements::DfDropStage;
use databend_query::sql::statements::DfDropTable;
+use databend_query::sql::statements::DfDropUDF;
use databend_query::sql::statements::DfDropUser;
use databend_query::sql::statements::DfGrantObject;
use databend_query::sql::statements::DfGrantStatement;
@@ -1370,6 +1371,27 @@ fn test_create_udf() -> Result<()> {
Ok(())
}
+#[test]
+fn test_drop_udf() -> Result<()> {
+ expect_parse_ok(
+ "DROP FUNCTION test_udf",
+ DfStatement::DropUDF(DfDropUDF {
+ if_exists: false,
+ udf_name: "test_udf".to_string(),
+ }),
+ )?;
+
+ expect_parse_ok(
+ "DROP FUNCTION IF EXISTS test_udf",
+ DfStatement::DropUDF(DfDropUDF {
+ if_exists: true,
+ udf_name: "test_udf".to_string(),
+ }),
+ )?;
+
+ Ok(())
+}
+
#[test]
fn test_alter_udf() -> Result<()> {
expect_parse_ok(
