-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-14013][SQL] Proper temp function support in catalog #11972
Conversation
cc @yhuai I took a quick look and it looks good -- but I didn't look at the details. |
Test build #54238 has finished for PR 11972 at commit
|
@@ -476,33 +497,29 @@ class SessionCatalog(externalCatalog: ExternalCatalog, conf: CatalystConf) { | |||
throw new AnalysisException("rename does not support moving functions across databases") | |||
} | |||
val db = oldName.database.getOrElse(currentDb) | |||
if (oldName.database.isDefined || !tempFunctions.containsKey(oldName.funcName)) { | |||
lazy val oldBuilder = functionRegistry.lookupFunctionBuilder(oldName.funcName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why use lazy val?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if database is defined we don't need to do it; this could save us a call to Hive
Overall looks good. |
Test build #54341 has finished for PR 11972 at commit
|
retest this please |
Test build #54362 has finished for PR 11972 at commit
|
OK thanks, I'm merging this to unblock progress on other issues. |
Test build #54383 has finished for PR 11972 at commit
|
What changes were proposed in this pull request?
Session catalog was added in #11750. However, it doesn't really support temporary functions properly; right now we only store the metadata in the form of
CatalogFunction
, but this doesn't make sense for temporary functions because there is no class name.This patch moves the
FunctionRegistry
into theSessionCatalog
. With this, the user can callcatalog.createTempFunction
andcatalog.lookupFunction
to use the function they registered previously. This is currently still dead code, however.How was this patch tested?
SessionCatalogSuite
.