You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2024/10/09 13:52:12 UTC
Re: [PR] [SPARK-49856][SQL] Refactor the compileExpression of JdbcDialect for simplify the subclass. [spark]
cloud-fan commented on code in PR #48322:
URL: https://github.com/apache/spark/pull/48322#discussion_r1793570990
##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala:
##########
@@ -476,16 +476,21 @@ abstract class JdbcDialect extends Serializable with Logging {
@Since("3.3.0")
def isSupportedFunction(funcName: String): Boolean = false
+ /**
+ * The [[JDBCSQLBuilder]] that match database dialect.
+ */
+ @Since("4.0.0")
+ protected[jdbc] def jdbcSQLBuilder(): JDBCSQLBuilder = new JDBCSQLBuilder()
+
/**
* Converts V2 expression to String representing a SQL expression.
* @param expr The V2 expression to be converted.
* @return Converted value.
*/
@Since("3.3.0")
def compileExpression(expr: Expression): Option[String] = {
- val jdbcSQLBuilder = new JDBCSQLBuilder()
Review Comment:
I'm not sure if it's worthwhile to add a new API for saving like copying 10 line of code... but I don't have a strong preference on this.
cc @milastdbx
--
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