[
https://issues.apache.org/jira/browse/SPARK-25098?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ice bai updated SPARK-25098:
----------------------------
Description:
UDF ‘Cast’ will return NULL when input string starts/ends with special
character, but hive doesn't.
For examle, we get hour from a string ends with a blank :
hive:
```
hive> select hour('2018-07-27 17:20:07 ');//end with a blank
OK
17
```
spark-sql:
```
spark-sql> select hour('2018-07-27 17:20:07 ');//end with a blank
NULL
```
was:
UDF ‘Cast’ will return NULL when input string starts/ends with special
character, but hive doesn't.
For examle, get hour from a string ends with a blank :
hive:
```
hive> select hour('2018-07-27 17:20:07 ');//end with a blank
OK
17
```
spark-sql:
```
spark-sql> select hour('2018-07-27 17:20:07 ');//end with a blank
NULL
```
> UDF ‘Cast’ will return NULL when input string starts/ends with special
> character
> ---------------------------------------------------------------------------------
>
> Key: SPARK-25098
> URL: https://issues.apache.org/jira/browse/SPARK-25098
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 2.3.0
> Reporter: ice bai
> Priority: Major
>
> UDF ‘Cast’ will return NULL when input string starts/ends with special
> character, but hive doesn't.
> For examle, we get hour from a string ends with a blank :
> hive:
> ```
> hive> select hour('2018-07-27 17:20:07 ');//end with a blank
> OK
> 17
> ```
> spark-sql:
> ```
> spark-sql> select hour('2018-07-27 17:20:07 ');//end with a blank
> NULL
> ```
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]