[ 
https://issues.apache.org/jira/browse/SPARK-10485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14901394#comment-14901394
 ] 

Wenchen Fan commented on SPARK-10485:
-------------------------------------

Hi [~ajnavarro], can you reproduce it in 1.5? We do have data type check for IF 
but we also have type coercions to cast null type if needed.

> IF expression is not correctly resolved when one of the options have NullType
> -----------------------------------------------------------------------------
>
>                 Key: SPARK-10485
>                 URL: https://issues.apache.org/jira/browse/SPARK-10485
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.4.1, 1.5.0
>            Reporter: Antonio Jesus Navarro
>
> If we have this query:
> {code}
> SELECT IF(column > 1, 1, NULL) FROM T1
> {code}
> On Spark 1.4.1 we have this:
> {code}
> override lazy val resolved = childrenResolved && trueValue.dataType == 
> falseValue.dataType
> {code}
> So if one of the types is NullType, the if expression is not resolved.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to