[ 
https://issues.apache.org/jira/browse/CALCITE-5662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oliver Lee updated CALCITE-5662:
--------------------------------
    Description: 
Currently attempting to run {{SELECT CAST(BOOLEAN as INTEGER)}} will throw a 
{{NumberFormatException}}.

The BigQuery dialect allows casting {{boolean}} to {{int64}} and {{string}}, 
and not for decimal, bigdecimal, numeric, etc. 

src: 
https://cloud.google.com/bigquery/docs/reference/standard-sql/conversion_functions
 

Desired behavior:

{{SELECT CAST(TRUE as INTEGER)}} -> {{1}}
{{SELECT CAST(FALSE as INTEGER)}} -> {{0}}

  was:
Currently attempting to run {{SELECT CAST(BOOLEAN as INTEGER)}} will throw a 
{{NumberFormatException}}.

The BigQuery dialect allows casting {{boolean}} to {{int64}} and {{string}}, 
and not for decimal, bigdecimal, numeric, etc. 

src: 
https://cloud.google.com/bigquery/docs/reference/standard-sql/conversion_functions
 




> CAST(BOOLEAN as INTEGER) throws a NumberFormatException
> -------------------------------------------------------
>
>                 Key: CALCITE-5662
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5662
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Oliver Lee
>            Assignee: Oliver Lee
>            Priority: Minor
>
> Currently attempting to run {{SELECT CAST(BOOLEAN as INTEGER)}} will throw a 
> {{NumberFormatException}}.
> The BigQuery dialect allows casting {{boolean}} to {{int64}} and {{string}}, 
> and not for decimal, bigdecimal, numeric, etc. 
> src: 
> https://cloud.google.com/bigquery/docs/reference/standard-sql/conversion_functions
>  
> Desired behavior:
> {{SELECT CAST(TRUE as INTEGER)}} -> {{1}}
> {{SELECT CAST(FALSE as INTEGER)}} -> {{0}}



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

Reply via email to