andrej-db commented on code in PR #48621:
URL: https://github.com/apache/spark/pull/48621#discussion_r1846812571


##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala:
##########
@@ -377,6 +378,17 @@ abstract class JdbcDialect extends Serializable with 
Logging {
   }
 
   private[jdbc] class JDBCSQLBuilder extends V2ExpressionSQLBuilder {
+    def inputToCaseWhenSQL(input: Expression): String =
+      "CASE WHEN " + inputToSQL(input) + " THEN 1 ELSE 0 END"
+
+    def inputToIntSQL(expr: Expression): String = {
+      expr match {
+        case p: Predicate if p.name() != "ALWAYS_TRUE" && p.name() != 
"ALWAYS_FALSE" =>

Review Comment:
   ```
   override def compileValue(value: Any): Any = value match {
       case booleanValue: Boolean => if (booleanValue) 1 else 0
       case other => super.compileValue(other)
     }
   ```
   
   in MsSqlServerDialect



-- 
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-unsubscr...@spark.apache.org

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


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

Reply via email to