beliefer commented on code in PR #45564:
URL: https://github.com/apache/spark/pull/45564#discussion_r1533460412
##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/MsSqlServerDialect.scala:
##########
@@ -86,6 +86,35 @@ private object MsSqlServerDialect extends JdbcDialect {
case "STDDEV_SAMP" => "STDEV"
case _ => super.dialectFunctionName(funcName)
}
+
+ override def build(expr: Expression): String = {
+ def isChildLikeExpression(child: Expression): Boolean = child match {
+ case gse: GeneralScalarExpression =>
+ gse.name() match {
+ case "STARTS_WITH" | "ENDS_WITH" | "CONTAINS" => true
+ case _ => false
+ }
+ case _ => false
+ }
+
+ // MsSqlServer does not support boolean comparison using standard
comparison operators
+ // LIKE operator has a boolean result, hence we don't propagate these
queries to MsSqlServer
+ expr match {
+ case e: GeneralScalarExpression =>
+ e.name() match {
+ case "=" | "<>" | "<=>" | "<" | "<=" | ">" | ">=" =>
Review Comment:
Shall we overwrite `visitBinaryComparison` and convert the boolean to
integer type ? we can avoid the issue.
--
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]