Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-25028

Hive: Select query with IS operator producing unexpected result

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • Parser

    Description

      Hive: Select query with IS operator is producing unexpected result.

      The following was executed on postgres:

      sqlancer=# create table if not exists emp(name text, age int);
      CREATE TABLE
      sqlancer=# insert into emp values ('a', 5), ('b', 15), ('c', 12);
      INSERT 0 3
      sqlancer=# select emp.age from emp where emp.age > 10;
       age
      -----
        15
        12
      (2 rows)sqlancer=# select emp.age > 10 is true from emp;
       ?column?
      ----------
       f
       t
       t
      (3 rows)

      This is happening because IS operator has higher precedence than comparison operators in Hive. In most other databases, comparison operator has higher precedence. The grammar needs to be changed to fix the precedence.

      Attachments

        Issue Links

          Activity

            People

              soumyakanti.das Soumyakanti Das
              mby Manthan B Y
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m