Hive
  1. Hive
  2. HIVE-4039

Hive compiler sometimes fails in semantic analysis / optimisation stage when boolean variable appears in WHERE clause.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.11.0
    • Component/s: Query Processor
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Release Note:
      I have changed the code, and added in a test file

      Description

      Hive compiler fails with a NullPointerException in semantic analysis / optimisation stage when a boolean variable appears in the WHERE clause in some cases. A minimal query to generate this error is here:
      SELECT 1
      FROM (
      SELECT TRUE AS flag
      FROM dim_one_row:measurementsystems
      ) a
      WHERE flag;

      On the other hand, the following query is perfectly fine:
      SELECT 1
      FROM (
      SELECT TRUE AS flag
      FROM dim_one_row:measurementsystems
      ) a
      WHERE flag=TRUE;

        Activity

        Jean Xu created issue -
        Jean Xu made changes -
        Field Original Value New Value
        Assignee Jean Xu [ jeanxu ]
        Jean Xu made changes -
        Attachment HIVE_4039.1.patch.txt [ 12569979 ]
        Jean Xu made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Release Note I have changed the code, and added in a test file
        Hide
        Namit Jain added a comment -

        +1

        Show
        Namit Jain added a comment - +1
        Hide
        Namit Jain added a comment -

        Committed. Thanks Jean

        Show
        Namit Jain added a comment - Committed. Thanks Jean
        Namit Jain made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags Reviewed [ 10343 ]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        Integrated in hive-trunk-hadoop1 #93 (See https://builds.apache.org/job/hive-trunk-hadoop1/93/)
        HIVE-4039 Hive compiler sometimes fails in semantic analysis / optimisation stage when boolean
        variable appears in WHERE clause. (Jezn Xu via namit) (Revision 1448135)

        Result = ABORTED
        namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1448135
        Files :

        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerProcFactory.java
        • /hive/trunk/ql/src/test/queries/clientpositive/test_boolean_whereclause.q
        • /hive/trunk/ql/src/test/results/clientpositive/test_boolean_whereclause.q.out
        Show
        Hudson added a comment - Integrated in hive-trunk-hadoop1 #93 (See https://builds.apache.org/job/hive-trunk-hadoop1/93/ ) HIVE-4039 Hive compiler sometimes fails in semantic analysis / optimisation stage when boolean variable appears in WHERE clause. (Jezn Xu via namit) (Revision 1448135) Result = ABORTED namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1448135 Files : /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerProcFactory.java /hive/trunk/ql/src/test/queries/clientpositive/test_boolean_whereclause.q /hive/trunk/ql/src/test/results/clientpositive/test_boolean_whereclause.q.out
        Hide
        Hudson added a comment -

        Integrated in Hive-trunk-hadoop2 #130 (See https://builds.apache.org/job/Hive-trunk-hadoop2/130/)
        HIVE-4039 Hive compiler sometimes fails in semantic analysis / optimisation stage when boolean
        variable appears in WHERE clause. (Jezn Xu via namit) (Revision 1448135)

        Result = FAILURE
        namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1448135
        Files :

        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerProcFactory.java
        • /hive/trunk/ql/src/test/queries/clientpositive/test_boolean_whereclause.q
        • /hive/trunk/ql/src/test/results/clientpositive/test_boolean_whereclause.q.out
        Show
        Hudson added a comment - Integrated in Hive-trunk-hadoop2 #130 (See https://builds.apache.org/job/Hive-trunk-hadoop2/130/ ) HIVE-4039 Hive compiler sometimes fails in semantic analysis / optimisation stage when boolean variable appears in WHERE clause. (Jezn Xu via namit) (Revision 1448135) Result = FAILURE namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1448135 Files : /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerProcFactory.java /hive/trunk/ql/src/test/queries/clientpositive/test_boolean_whereclause.q /hive/trunk/ql/src/test/results/clientpositive/test_boolean_whereclause.q.out
        Hide
        Hudson added a comment -

        Integrated in Hive-trunk-h0.21 #1978 (See https://builds.apache.org/job/Hive-trunk-h0.21/1978/)
        HIVE-4039 Hive compiler sometimes fails in semantic analysis / optimisation stage when boolean
        variable appears in WHERE clause. (Jezn Xu via namit) (Revision 1448135)

        Result = SUCCESS
        namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1448135
        Files :

        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerProcFactory.java
        • /hive/trunk/ql/src/test/queries/clientpositive/test_boolean_whereclause.q
        • /hive/trunk/ql/src/test/results/clientpositive/test_boolean_whereclause.q.out
        Show
        Hudson added a comment - Integrated in Hive-trunk-h0.21 #1978 (See https://builds.apache.org/job/Hive-trunk-h0.21/1978/ ) HIVE-4039 Hive compiler sometimes fails in semantic analysis / optimisation stage when boolean variable appears in WHERE clause. (Jezn Xu via namit) (Revision 1448135) Result = SUCCESS namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1448135 Files : /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerProcFactory.java /hive/trunk/ql/src/test/queries/clientpositive/test_boolean_whereclause.q /hive/trunk/ql/src/test/results/clientpositive/test_boolean_whereclause.q.out
        Owen O'Malley made changes -
        Fix Version/s 0.11.0 [ 12323587 ]
        Owen O'Malley made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Jean Xu
            Reporter:
            Jean Xu
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development