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/02/15 02:02:53 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #35494: [SPARK-38196][SQL] Reactor framework so as JDBC dialect could compile expression by self way

HyukjinKwon commented on a change in pull request #35494:
URL: https://github.com/apache/spark/pull/35494#discussion_r806386913



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala
##########
@@ -194,6 +194,66 @@ abstract class JdbcDialect extends Serializable with Logging{
     case _ => value
   }
 
+  protected final val BINARY_COMPARISON = Set("=", "!=", "<=>", "<", "<=", ">", ">=",
+    "+", "-", "*", "/", "%", "&&", "||", "AND", "OR", "&", "|", "^")
+
+  /**
+   * 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] = expr match {
+    case l @ LiteralValue(_, _) => Some(l.toString)

Review comment:
       Yeah. There was a try to repalce them all but it was rejected as it's too invasive. We should better avoid them anyway.




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