You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/05/13 00:51:39 UTC

[GitHub] [spark] huaxingao commented on a diff in pull request #36521: [SPARK-39162][SQL] Jdbc dialect should decide which function could be pushed down

huaxingao commented on code in PR #36521:
URL: https://github.com/apache/spark/pull/36521#discussion_r871917477


##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala:
##########
@@ -240,8 +240,31 @@ abstract class JdbcDialect extends Serializable with Logging{
         getJDBCType(dataType).map(_.databaseTypeDefinition).getOrElse(dataType.typeName)
       s"CAST($l AS $databaseTypeDefinition)"
     }
+
+    override def visitSQLFunction(funcName: String, inputs: Array[String]): String = {
+      if (isSupportedFunction(funcName)) {
+        s"""$funcName(${inputs.mkString(", ")})"""
+      } else {
+        throw QueryCompilationErrors.noSuchFunctionError(dialectName, funcName)
+      }
+    }
   }
 
+  /**
+   * Returns whether the database supports function.
+   * @param funcName Function name
+   * @return True if the database supports function.
+   */
+  @Since("3.4.0")

Review Comment:
   Should we include this change in 3.3.0? The function push down is in 3.3.0.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org