You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Abhishek Girish (JIRA)" <ji...@apache.org> on 2017/06/19 04:26:00 UTC

[jira] [Created] (DRILL-5595) Casting Floating-point types to Boolean types should be supported

Abhishek Girish created DRILL-5595:
--------------------------------------

             Summary: Casting Floating-point types to Boolean types should be supported
                 Key: DRILL-5595
                 URL: https://issues.apache.org/jira/browse/DRILL-5595
             Project: Apache Drill
          Issue Type: Bug
          Components: Execution - Data Types, Query Planning & Optimization
    Affects Versions: 1.11.0
            Reporter: Abhishek Girish
            Assignee: Chunhui Shi


Today, only Int and BigInt can be casted to Boolean. Casting Float / Double values to Boolean fails: 

{code}
select cast(1.0 as boolean) from (values(1));
Error: SYSTEM ERROR: IllegalArgumentException: Invalid value for boolean: 1.0

select cast(t.a as boolean) from (select cast(1.0 as float) as a from (values(1))) t;
Error: SYSTEM ERROR: IllegalArgumentException: Invalid value for boolean: 1.0
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)