Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-13554 [Umbrella] SQL:2011 compliance
  3. HIVE-16505

Support "unknown" boolean truth value

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0.0-alpha-1
    • SQL

    Description

      according to the standard, boolean truth value might be: TRUE|FALSE|UNKNOWN.

      similar queries to the following should be supported:

      select 1 where null is unknown;
      select 1 where (select cast(null as boolean) ) is unknown;
      

      "unknown" behaves similarily to null. (null=null) is null

       

      "All boolean values and SQL truth values are comparable and all are assignable to a site of type boolean. The value True is greater than the value False, and any comparison involving the null value or an Unknown truth value will return an Unknown result. The values True and False may be assigned to any site having a boolean data type; assignment of Unknown, or the null value, is subject to the nullability characteristic of the target."

       

      Truth table for the AND boolean operator
      AND True False Unknown
      True True False Unknown
      False False False False
      Unknown Unknown False Unknown

      Truth table for the OR boolean operator
      OR True False Unknown
      True True True True
      False True False Unknown
      Unknown True Unknown Unknown

      Truth table for the IS boolean operator
      IS TRUE FALSE UNKNOWN
      True True False False
      False False True False
      Unknown False False True

       

      Attachments

        1. HIVE-16505.01.patch
          6 kB
          László Bodor
        2. HIVE-16505.02.patch
          6 kB
          László Bodor
        3. HIVE-16505.03.patch
          6 kB
          László Bodor
        4. HIVE-16505.04.patch
          6 kB
          László Bodor

        Issue Links

          Activity

            People

              abstractdog László Bodor
              kgyrtkirk Zoltan Haindrich
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: