cloud-fan commented on code in PR #43720:
URL: https://github.com/apache/spark/pull/43720#discussion_r1386754391
##########
sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala:
##########
@@ -284,6 +284,32 @@ class CatalogImpl(sparkSession: SparkSession) extends
Catalog {
CatalogImpl.makeDataset(functions.result(), sparkSession)
}
+ private def toFunctionIdent(functionName: String): Seq[String] = {
+ val parsed = parseIdent(functionName)
+ // For backward compatibility (Spark 3.3 and prior), we should check if
the function exists in
+ // the Hive Metastore first.
+ if (parsed.length <= 2 &&
+ !sessionCatalog.isTemporaryFunction(parsed.asFunctionIdentifier) &&
+ sessionCatalog.isPersistentFunction(parsed.asFunctionIdentifier)) {
+ qualifyV1Ident(parsed)
+ } else {
+ parsed
+ }
+ }
+
+ private def functionExists(nameParts: Seq[String]): Boolean = {
+ val plan = UnresolvedFunctionName(nameParts, "Catalog.functionExists",
false, None)
Review Comment:
do you mean `"Catalog.functionExists"`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]