Skip to content

Commit 9e09875

Browse files
committed
fix mistake
1 parent de54470 commit 9e09875

4 files changed

Lines changed: 7 additions & 10 deletions

File tree

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3652,7 +3652,7 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef] with Logging
36523652

36533653
override def visitRefreshFunction(ctx: RefreshFunctionContext): LogicalPlan = withOrigin(ctx) {
36543654
val functionIdentifier = visitMultipartIdentifier(ctx.multipartIdentifier)
3655-
RefreshFunction(UnresolvedNamespace(functionIdentifier))
3655+
RefreshFunction(functionIdentifier)
36563656
}
36573657

36583658
override def visitCommentNamespace(ctx: CommentNamespaceContext): LogicalPlan = withOrigin(ctx) {

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/v2Commands.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,4 +520,4 @@ case class CommentOnTable(child: LogicalPlan, comment: String) extends Command {
520520
/**
521521
* The logical plan of the REFRESH FUNCTION command that works for v2 catalogs.
522522
*/
523-
case class RefreshFunction(func: LogicalPlan) extends Command
523+
case class RefreshFunction(func: Seq[String]) extends Command

sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/DDLParserSuite.scala

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,12 +2114,9 @@ class DDLParserSuite extends AnalysisTest {
21142114
}
21152115

21162116
test("REFRESH FUNCTION") {
2117-
parseCompare("REFRESH FUNCTION c",
2118-
RefreshFunction(UnresolvedNamespace(Seq("c"))))
2119-
parseCompare("REFRESH FUNCTION b.c",
2120-
RefreshFunction(UnresolvedNamespace(Seq("b", "c"))))
2121-
parseCompare("REFRESH FUNCTION a.b.c",
2122-
RefreshFunction(UnresolvedNamespace(Seq("a", "b", "c"))))
2117+
parseCompare("REFRESH FUNCTION c", RefreshFunction(Seq("c")))
2118+
parseCompare("REFRESH FUNCTION b.c", RefreshFunction(Seq("b", "c")))
2119+
parseCompare("REFRESH FUNCTION a.b.c", RefreshFunction(Seq("a", "b", "c")))
21232120
}
21242121

21252122
private case class TableSpec(

sql/core/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveSessionCatalog.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,9 @@ class ResolveSessionCatalog(
612612
replace)
613613
}
614614

615-
case RefreshFunction(ResolvedNamespace(_, ns)) =>
615+
case RefreshFunction(func) =>
616616
val FunctionIdentifier(function, database) =
617-
parseSessionCatalogFunctionIdentifier(ns, "REFRESH FUNCTION")
617+
parseSessionCatalogFunctionIdentifier(func, "REFRESH FUNCTION")
618618
// Fallback to v1 command
619619
RefreshFunctionCommand(database, function)
620620
}

0 commit comments

Comments
 (0)