Github user HyukjinKwon commented on the issue:
https://github.com/apache/spark/pull/15609
@priyankagargnitk Could I please ask some codes which I can reproduce this
issue? It seems fine the sql below:
```sql
spark-sql> SELECT if(true, cast('2014-01-01' as date), cast('2014-12-12' as
timestamp));
2014-01-01 00:00:00
```
I just checked and it seems this is covered in
[TypeCoercion.scala#L596-L601](https://github.com/apache/spark/blob/39e2bad6a866d27c3ca594d15e574a1da3ee84cc/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala#L596-L601).
It seems the cases here are unreachable to end users.
Also, it seems it can't just cast it. For example, if we add a test with
`IntegerType` and `StringType` here, i guess it'd be failed due to the cast.
---
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]