Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-3812

HANA MIN and MAX functions not applicable on boolean

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.12.2, 8.13
    • 8.7.1.6_2
    • Misc. Connectors
    • None
    • Hide
      1. prepare a HANA table with BOOLEAN column (table=BQT1.SmallA, column=BooleanValue)
      2. connect to a vdb with HANA source
      3. run query SELECT MIN(true) FROM BQT1.SmallA
      4. run query SELECT MIN(BooleanValue) FROM BQT1.SmallA
      5. repeat the same for PostgreSQL if interested
      Show
      prepare a HANA table with BOOLEAN column (table=BQT1.SmallA, column=BooleanValue) connect to a vdb with HANA source run query SELECT MIN(true) FROM BQT1.SmallA run query SELECT MIN(BooleanValue) FROM BQT1.SmallA repeat the same for PostgreSQL if interested
      1. Explicitly cast the boolean values to TINYINT

      SAP HANA doesn't support MIN and MAX functions for BOOLEAN type.
      Compared to postgresql, which also has BOOLEAN data type, it seems inconsistent, as postgresql translator mimics MIN and MAX functions by translating them using PostgreSQL specific constructs:
      min(BooleanValue) as bool_and(BooleanValue)
      max(BooleanValue) as bool_or(BooleanValue)

      Similar issue is with CEILING and FLOOR functions.

            [TEIID-3812] HANA MIN and MAX functions not applicable on boolean

            Filip Elias <felias@redhat.com> changed the Status of bug 1279399 from VERIFIED to CLOSED

            RH Bugzilla Integration added a comment - Filip Elias <felias@redhat.com> changed the Status of bug 1279399 from VERIFIED to CLOSED

            Jan Stastny <jstastny@redhat.com> changed the Status of bug 1279399 from ON_QA to VERIFIED

            RH Bugzilla Integration added a comment - Jan Stastny <jstastny@redhat.com> changed the Status of bug 1279399 from ON_QA to VERIFIED

            Van Halbert <vhalbert@redhat.com> changed the Status of bug 1279399 from MODIFIED to ON_QA

            RH Bugzilla Integration added a comment - Van Halbert <vhalbert@redhat.com> changed the Status of bug 1279399 from MODIFIED to ON_QA

            Van Halbert <vhalbert@redhat.com> changed the Status of bug 1279399 from NEW to MODIFIED

            RH Bugzilla Integration added a comment - Van Halbert <vhalbert@redhat.com> changed the Status of bug 1279399 from NEW to MODIFIED

            Changed to compute the min/max by casting to tinyint and then converting the expression back to boolean.

            Steven Hawkins added a comment - Changed to compute the min/max by casting to tinyint and then converting the expression back to boolean.

            Jan Stastny added a comment -

            Based on Steven's comment I created https://issues.jboss.org/browse/TEIID-3817

            Jan Stastny added a comment - Based on Steven's comment I created https://issues.jboss.org/browse/TEIID-3817

            Floor/Ceiling expect the argument to be a double, so that would be a different issue. Can you log that separately?

            Steven Hawkins added a comment - Floor/Ceiling expect the argument to be a double, so that would be a different issue. Can you log that separately?

              rhn-engineering-shawkins Steven Hawkins
              jstastny@redhat.com Jan Stastny
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: