-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-40482][SQL] Revert SPARK-24544 Print actual failure cause when look up function failed
#37896
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-40482][SQL] Revert SPARK-24544 Print actual failure cause when look up function failed
#37896
Changes from 1 commit
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 |
|---|---|---|
|
|
@@ -31,7 +31,6 @@ import org.apache.hadoop.conf.Configuration | |
| import org.apache.hadoop.fs.Path | ||
|
|
||
| import org.apache.spark.internal.Logging | ||
| import org.apache.spark.sql.AnalysisException | ||
| import org.apache.spark.sql.catalyst._ | ||
| import org.apache.spark.sql.catalyst.analysis._ | ||
| import org.apache.spark.sql.catalyst.analysis.FunctionRegistry.FunctionBuilder | ||
|
|
@@ -1588,10 +1587,9 @@ class SessionCatalog( | |
| TableFunctionRegistry.builtin.functionExists(name) | ||
| } | ||
|
|
||
| protected[sql] def failFunctionLookup( | ||
|
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. Hmm, where do we set
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. We used to pass the |
||
| name: FunctionIdentifier, cause: Option[Throwable] = None): Nothing = { | ||
| protected[sql] def failFunctionLookup(name: FunctionIdentifier): Nothing = { | ||
| throw new NoSuchFunctionException( | ||
| db = name.database.getOrElse(getCurrentDatabase), func = name.funcName, cause) | ||
| db = name.database.getOrElse(getCurrentDatabase), func = name.funcName) | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -1732,11 +1730,7 @@ class SessionCatalog( | |
| // The function has not been loaded to the function registry, which means | ||
| // that the function is a persistent function (if it actually has been registered | ||
| // in the metastore). We need to first put the function in the function registry. | ||
| val catalogFunction = try { | ||
| externalCatalog.getFunction(db, funcName) | ||
| } catch { | ||
| case _: AnalysisException => failFunctionLookup(qualifiedIdent) | ||
| } | ||
| val catalogFunction = externalCatalog.getFunction(db, funcName) | ||
|
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. not quite related but it's obviously redundant to try-catch and re-throw the error. |
||
| loadFunctionResources(catalogFunction.resources) | ||
| // Please note that qualifiedName is provided by the user. However, | ||
| // catalogFunction.identifier.unquotedString is returned by the underlying | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.