Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Currently attempting to run SELECT CAST(BOOLEAN as INTEGER) will throw a NumberFormatException.
The BigQuery dialect allows casting boolean literals to the following: string, int64 , tinyint, smallint, bigint
src: https://cloud.google.com/bigquery/docs/reference/standard-sql/conversion_functions
Desired behavior:
SELECT CAST(TRUE as INTEGER) -> 1
SELECT CAST(TRUE as BIGINT) -> 1
SELECT CAST(FALSE as INTEGER) -> 0
SELECT CAST(null as INTEGER) -> null
Attachments
Issue Links
- relates to
-
CALCITE-4782 Allow 'CAST(numeric AS BOOLEAN)' (if enabled by conformance)
- Open
- links to