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

Julian Hyde edited comment on CALCITE-5557 at 3/22/23 9:09 PM:
---------------------------------------------------------------

Fixed in 
[ba36004f|https://github.com/apache/calcite/commit/ba36004fb1e52b9bfb06623c7d869e6e01e25082].
 Thanks for the PR and reviews, [~oliverlee] and [~julianhyde].


was (Author: zabetak):
Fixed in 
https://github.com/apache/calcite/commit/093fa7ba3b8ba9773a69c59502fe49f4956a3ebb.
 Thanks for the PR and reviews [~oliverlee] [~julianhyde].

> Add SAFE_CAST (BigQuery compatibility)
> --------------------------------------
>
>                 Key: CALCITE-5557
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5557
>             Project: Calcite
>          Issue Type: New Feature
>            Reporter: Oliver Lee
>            Assignee: Oliver Lee
>            Priority: Minor
>             Fix For: 1.35.0
>
>
> Implement SAFE_CAST per BigQuery specifications
> [https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#safe_casting]
> Equivalent to CAST(), except it will return {{null}} instead of throwing an 
> exception if the casting fails.
> {quote}SAFE_CAST('1' as INT) -> 1
> SAFE_CAST('a' as INT) -> NULL
> SAFE_CAST("2022-12-12" as DATE) -> DATE('2022-12-12')
> SAFE_CAST(1 AS BOOLEAN) -> true
> SAFE_CAST('A' AS BOOLEAN) -> null
> {quote}
>  



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

Reply via email to