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

Yeachan Park commented on SPARK-30292:
--------------------------------------

Does anyone know why this behaviour is coupled to the ANSI SQL setting? This 
seems like useful functionality that someone would want whilst casting without 
also enabling the whole host of other ANSI compliant behaviour.

> Throw Exception when invalid string is cast to decimal in ANSI mode
> -------------------------------------------------------------------
>
>                 Key: SPARK-30292
>                 URL: https://issues.apache.org/jira/browse/SPARK-30292
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: Rakesh Raushan
>            Assignee: Rakesh Raushan
>            Priority: Minor
>             Fix For: 3.0.0
>
>
> When spark.sql.ansi.enabled is set,
> If we run select cast('str' as decimal), spark-sql outputs NULL. 
> The ANSI SQL standard requires to throw exception when invalid strings are 
> cast to numbers.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to