You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2025/08/18 06:26:22 UTC

Re: [PR] [SPARK-33538][SQL] Directly push IN/NOT predicates to the Hive Metastore [spark]

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


##########
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala:
##########
@@ -749,12 +749,12 @@ private[client] class Shim_v2_0 extends Shim with Logging {
       }
     }
 
-    def convertInToOr(name: String, values: Seq[String]): String = {
-      values.map(value => s"$name = $value").mkString("(", " or ", ")")
+    def convertIn(name: String, values: Seq[String]): String = {
+      s"($name) in (${values.mkString(", ")})"

Review Comment:
   optimizer rules can be disabled. I think we should not make any assumption about how the original predicate expression will look like. The translation here should be safe by its own. Can we handle empty list and null values here?



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