Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-5595

Casting Floating-point types to Boolean types should be supported

    XMLWordPrintableJSON

Details

    Description

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

      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
      

      Attachments

        Activity

          People

            cshi Chunhui Shi
            agirish Abhishek Girish
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: