Github user viirya commented on the issue:

    https://github.com/apache/spark/pull/21848
  
    This is a good point.
    
    On Mon, Jul 23, 2018, 12:03 PM Dongjoon Hyun <notificati...@github.com>
    wrote:
    
    > Since this skips the evaluation of if condition, this will cause the
    > following difference.
    >
    > *This PR*
    >
    > scala> sql("select * from t").show
    > +----+
    > |   a|
    > +----+
    > |   1|
    > |null|
    > +----+
    >
    > scala> sql("select if(assert_true(a is null),a,a) from t").show
    > +-----------------------------------------------------+
    > |(IF(CAST(assert_true((a IS NULL)) AS BOOLEAN), a, a))|
    > +-----------------------------------------------------+
    > |                                                    1|
    > |                                                 null|
    > +-----------------------------------------------------+
    >
    > *Spark 2.3.1*
    >
    > scala> sql("select * from t").show
    > +----+
    > |   a|
    > +----+
    > |   1|
    > |null|
    > +----+
    >
    > scala> sql("select if(assert_true(a is null),a,a) from t").show
    > 18/07/23 11:59:11 ERROR Executor: Exception in task 0.0 in stage 20.0 
(TID 20)
    > java.lang.RuntimeException: 'isnull(input[0, int, true])' is not true!
    >
    > —
    > You are receiving this because you commented.
    > Reply to this email directly, view it on GitHub
    > <https://github.com/apache/spark/pull/21848#issuecomment-407166299>, or 
mute
    > the thread
    > 
<https://github.com/notifications/unsubscribe-auth/AAEM99Jsk4Z9Nt7NV5zkdG9oWyUDY4OZks5uJh4RgaJpZM4VbZaO>
    > .
    >



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to