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/05/21 17:20:00 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=17349388#comment-17349388 ] 

Beam JIRA Bot commented on BEAM-11667:
--------------------------------------

This issue is P2 but has been unassigned without any comment for 60 days so it has been labeled "stale-P2". If this issue is still affecting you, we care! Please comment and remove the label. Otherwise, in 14 days the issue will be moved to P3.

Please see https://beam.apache.org/contribute/jira-priorities/ for a detailed explanation of what these priorities mean.


> 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: dsl-sql
>    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)