cloud-fan commented on code in PR #48621:
URL: https://github.com/apache/spark/pull/48621#discussion_r1849398391


##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala:
##########
@@ -377,6 +378,18 @@ abstract class JdbcDialect extends Serializable with 
Logging {
   }
 
   private[jdbc] class JDBCSQLBuilder extends V2ExpressionSQLBuilder {
+    // Some dialects do not support boolean type and this convenient util 
function is
+    // provided to generate SQL string without boolean values.
+    protected def inputToSQLNoPredicate(input: Expression): String = input 
match {
+      case p: Predicate if p.name() == "ALWAYS_TRUE" => "1"
+      case p: Predicate if p.name() == "ALWAYS_FALSE" => "0"
+      case p: Predicate => predicateToIntSQL(inputToSQL(p))
+      case p => inputToSQL(p)
+    }

Review Comment:
   ```suggestion
       protected def inputToSQLNoBool(input: Expression): String = input match {
         case p: Predicate if p.name() == "ALWAYS_TRUE" => "1"
         case p: Predicate if p.name() == "ALWAYS_FALSE" => "0"
         case p: Predicate => predicateToIntSQL(inputToSQL(p))
         case _ => inputToSQL(input)
       }
   ```



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