-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-32401][SQL] Migrate function related commands to use UnresolvedFunc to resolve function identifier #29198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
04f629d
38756fc
f149cf7
0e9f12f
daf4d6b
27f2fb1
7924572
c662619
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3600,7 +3600,7 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef] with Logging | |
| } else { | ||
| Seq(describeFuncName.getText) | ||
| } | ||
| DescribeFunctionStatement(functionName, EXTENDED != null) | ||
| DescribeFunction(UnresolvedFunc(functionName), EXTENDED != null) | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -3615,8 +3615,10 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef] with Logging | |
| case Some(x) => throw new ParseException(s"SHOW $x FUNCTIONS not supported", ctx) | ||
| } | ||
| val pattern = Option(ctx.pattern).map(string(_)) | ||
| val functionName = Option(ctx.multipartIdentifier).map(visitMultipartIdentifier) | ||
| ShowFunctionsStatement(userScope, systemScope, pattern, functionName) | ||
| val unresolvedFuncOpt = Option(ctx.multipartIdentifier) | ||
| .map(visitMultipartIdentifier) | ||
| .map(UnresolvedFunc(_)) | ||
| ShowFunctions(unresolvedFuncOpt, userScope, systemScope, pattern) | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -3629,8 +3631,8 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef] with Logging | |
| */ | ||
| override def visitDropFunction(ctx: DropFunctionContext): LogicalPlan = withOrigin(ctx) { | ||
| val functionName = visitMultipartIdentifier(ctx.multipartIdentifier) | ||
| DropFunctionStatement( | ||
| functionName, | ||
| DropFunction( | ||
| UnresolvedFunc(functionName), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will analyzer give a nice error if
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nvm, this won't happen for now. |
||
| ctx.EXISTS != null, | ||
| ctx.TEMPORARY != null) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -156,10 +156,7 @@ private[sql] trait LookupCatalog extends Logging { | |
| } | ||
| } | ||
|
|
||
| // TODO: move function related v2 statements to the new framework. | ||
| def parseSessionCatalogFunctionIdentifier( | ||
| nameParts: Seq[String], | ||
| sql: String): FunctionIdentifier = { | ||
| def parseSessionCatalogFunctionIdentifier(nameParts: Seq[String]): FunctionIdentifier = { | ||
| if (nameParts.length == 1 && catalogManager.v1SessionCatalog.isTempFunction(nameParts.head)) { | ||
| return FunctionIdentifier(nameParts.head) | ||
| } | ||
|
|
@@ -179,7 +176,7 @@ private[sql] trait LookupCatalog extends Logging { | |
| } | ||
| } | ||
|
|
||
| case _ => throw new AnalysisException(s"$sql is only supported in v1 catalog") | ||
| case _ => throw new AnalysisException("function is only supported in v1 catalog") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. function -> function command?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is called from |
||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.