damccorm opened a new issue, #20743:
URL: https://github.com/apache/beam/issues/20743

   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:
    
   ```
   
   ,CASE WHEN cast(IsService as BOOLEAN) THEN CASE WHEN IsEligible THEN 1 ELSE 
0 END ELSE NULL END AS
   Reported
   
   ```
   
   Where IsService is an indicator int and IsEligible is a boolean.
    
    I get the below error when I run the pipeline:
    
   ```
   
   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
   
   
   ```
   
   Calcite should be able to cast Int to boolean according to 
[documentation](https://calcite.apache.org/docs/reference.html#implicit-type-conversion)
 
   
   Imported from Jira 
[BEAM-11667](https://issues.apache.org/jira/browse/BEAM-11667). Original Jira 
may contain additional context.
   Reported by: arto08.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to