Github user yjshen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7523#discussion_r34969931
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/nullFunctions.scala
 ---
    @@ -198,14 +203,39 @@ case class AtLeastNNonNulls(n: Int, children: 
Seq[Expression]) extends Predicate
         val nonnull = ctx.freshName("nonnull")
         val code = children.map { e =>
           val eval = e.gen(ctx)
    -      s"""
    -        if ($nonnull < $n) {
    -          ${eval.code}
    -          if (!${eval.isNull}) {
    -            $nonnull += 1;
    -          }
    -        }
    -      """
    +      e.dataType match {
    +        case DoubleType =>
    +          s"""
    +            if ($nonnull < $n) {
    +              ${eval.code}
    +              if (!${eval.isNull}) {
    +                if (!Double.isNaN(${eval.primitive})) {
    --- End diff --
    
    yes, actually there's a bunch of code could just be checked with 
`Double.isNaN`, but use Float.isNaN and Double.isNaN separately, should I 
simplify them all?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to