cloud-fan commented on code in PR #37047:
URL: https://github.com/apache/spark/pull/37047#discussion_r913552918


##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala:
##########
@@ -253,6 +253,19 @@ abstract class JdbcDialect extends Serializable with 
Logging{
       }
     }
 
+    override def visitAggregateFunction(
+        funcName: String, isDistinct: Boolean, inputs: Array[String]): String 
= {
+      if (isSupportedFunction(funcName)) {
+        super.visitAggregateFunction(
+          dialectFunctionName(funcName).getOrElse(funcName), isDistinct, 
inputs)
+      } else {
+        throw new UnsupportedOperationException(
+          s"${this.getClass.getSimpleName} does not support aggregate 
function: $funcName");
+      }
+    }
+
+    protected def dialectFunctionName(funcName: String): Option[String] = None

Review Comment:
   shall we apply this in `visitSQLFunction`?



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