Details
-
New Feature
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
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.
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
Attachments
Issue Links
- causes
-
DRILL-8424 Accommodate RexBuilder changes made for SAFE_CAST
- Closed
- is related to
-
CALCITE-5923 SqlOperatorTest using safeParameters are not using overridable fixture
- Closed
- relates to
-
CALCITE-4771 Add TRY_CAST (MSSQL compatibility)
- Closed