You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Beam JIRA Bot (Jira)" <ji...@apache.org> on 2021/03/22 17:19:01 UTC

[jira] [Updated] (BEAM-11667) Cast function cannot convert value of type INTEGER to type BOOLEAN

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

Beam JIRA Bot updated BEAM-11667:
---------------------------------
    Labels: stale-P2  (was: )

> Cast function cannot convert value of type INTEGER to type BOOLEAN
> ------------------------------------------------------------------
>
>                 Key: BEAM-11667
>                 URL: https://issues.apache.org/jira/browse/BEAM-11667
>             Project: Beam
>          Issue Type: Bug
>          Components: beam-model
>    Affects Versions: 2.24.0
>            Reporter: Aro Barret
>            Priority: P2
>              Labels: stale-P2
>
> I'm trying to do a SQL transform using Calcite SQL syntax. I'm doing an int to boolean cast. My sql looks like this:
>  
> {code:java}
> ,CASE WHEN cast(IsService as BOOLEAN) THEN CASE WHEN IsEligible THEN 1 ELSE 0 END ELSE NULL END AS Reported
> {code}
> Where IsService is an indicator int and IsEligible is a boolean.
>  
>  I get the below error when I run the pipeline:
>  
> {code:java}
> Caused by: org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.sql.validate.SqlValidatorException: Cast function cannot convert value of type INTEGER to type BOOLEAN
> {code}
> Calcite should be able to cast Int to boolean according to [documentation|https://calcite.apache.org/docs/reference.html#implicit-type-conversion] 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)