cloud-fan commented on a change in pull request #35494:
URL: https://github.com/apache/spark/pull/35494#discussion_r814549510



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala
##########
@@ -194,6 +195,21 @@ abstract class JdbcDialect extends Serializable with 
Logging{
     case _ => value
   }
 
+  /**
+   * 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 V2ExpressionSQLBuilder = new V2ExpressionSQLBuilder()
+    try {
+      Some(V2ExpressionSQLBuilder.build(expr))

Review comment:
       Shall we have a JDBC v2 specific `V2ExpressionSQLBuilder` 
implementation? One requirement is that JDBC v2 should not support nested 
columns, so `visitFieldReference` should only work for single-part name.




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