packyan commented on code in PR #5055:
URL: https://github.com/apache/kyuubi/pull/5055#discussion_r1263555343


##########
extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/serde/functionExtractors.scala:
##########
@@ -29,13 +30,17 @@ object FunctionExtractor {
     loadExtractorsToMap[FunctionExtractor]
   }
 
-  def buildFunctionIdentFromQualifiedName(qualifiedName: String): (String, 
Option[String]) = {
-    val parts: Array[String] = qualifiedName.split("\\.", 2)
-    if (parts.length == 1) {
-      (qualifiedName, None)
+  private[authz] def buildFunctionFromQualifiedName(qualifiedName: String): 
Function = {
+    val partsLen = if (isSparkV34OrGreater) 3 else 2
+    val parts: Array[String] = qualifiedName.split("\\.", partsLen)
+    val (functionName, database) = if (parts.length == 1) {
+      (None, qualifiedName)
+    } else if (parts.length == 3) {
+      (Some(parts.tail.head), parts.last)
     } else {
-      (parts.last, Some(parts.head))
+      (Some(parts.head), parts.last)
     }
+    Function(functionName, database)

Review Comment:
   > Seems reversed.
   
   I adjust the function field order to kepp consistent with spark.



-- 
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]

Reply via email to