Skip to content

Commit

Permalink
fix mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
ulysses-you committed Jun 17, 2020
1 parent de54470 commit 9e09875
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
Expand Up @@ -3652,7 +3652,7 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef] with Logging

override def visitRefreshFunction(ctx: RefreshFunctionContext): LogicalPlan = withOrigin(ctx) {
val functionIdentifier = visitMultipartIdentifier(ctx.multipartIdentifier)
RefreshFunction(UnresolvedNamespace(functionIdentifier))
RefreshFunction(functionIdentifier)
}

override def visitCommentNamespace(ctx: CommentNamespaceContext): LogicalPlan = withOrigin(ctx) {
Expand Down
Expand Up @@ -520,4 +520,4 @@ case class CommentOnTable(child: LogicalPlan, comment: String) extends Command {
/**
* The logical plan of the REFRESH FUNCTION command that works for v2 catalogs.
*/
case class RefreshFunction(func: LogicalPlan) extends Command
case class RefreshFunction(func: Seq[String]) extends Command
Expand Up @@ -2114,12 +2114,9 @@ class DDLParserSuite extends AnalysisTest {
}

test("REFRESH FUNCTION") {
parseCompare("REFRESH FUNCTION c",
RefreshFunction(UnresolvedNamespace(Seq("c"))))
parseCompare("REFRESH FUNCTION b.c",
RefreshFunction(UnresolvedNamespace(Seq("b", "c"))))
parseCompare("REFRESH FUNCTION a.b.c",
RefreshFunction(UnresolvedNamespace(Seq("a", "b", "c"))))
parseCompare("REFRESH FUNCTION c", RefreshFunction(Seq("c")))
parseCompare("REFRESH FUNCTION b.c", RefreshFunction(Seq("b", "c")))
parseCompare("REFRESH FUNCTION a.b.c", RefreshFunction(Seq("a", "b", "c")))
}

private case class TableSpec(
Expand Down
Expand Up @@ -612,9 +612,9 @@ class ResolveSessionCatalog(
replace)
}

case RefreshFunction(ResolvedNamespace(_, ns)) =>
case RefreshFunction(func) =>
val FunctionIdentifier(function, database) =
parseSessionCatalogFunctionIdentifier(ns, "REFRESH FUNCTION")
parseSessionCatalogFunctionIdentifier(func, "REFRESH FUNCTION")
// Fallback to v1 command
RefreshFunctionCommand(database, function)
}
Expand Down

0 comments on commit 9e09875

Please sign in to comment.