AngersZhuuuu commented on a change in pull request #34097:
URL: https://github.com/apache/spark/pull/34097#discussion_r716158582
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala
##########
@@ -612,26 +612,27 @@ case class InSet(child: Expression, hset: Set[Any])
extends UnaryExpression with
""
}
- val ret = child.dataType match {
+ val isNaNCode = child.dataType match {
case DoubleType => Some((v: Any) => s"java.lang.Double.isNaN($v)")
case FloatType => Some((v: Any) => s"java.lang.Float.isNaN($v)")
case _ => None
}
- ret.map { isNaN =>
+ if (hasNaN && isNaNCode.isDefined) {
s"""
- |if ($setTerm.contains($c)) {
- | ${ev.value} = true;
- |} else if (${isNaN(c)}) {
- | ${ev.value} = $hasNaN;
- |}
- |$setIsNull
- |""".stripMargin
- }.getOrElse(
+ |if (${isNaNCode.get(c)}) {
+ | ${ev.value} = true;
Review comment:
done
--
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]