Hive
  1. Hive
  2. HIVE-2794

Aggregations without grouping should return NULL when applied to partitioning column of a partitionless table

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.11.0
    • Component/s: Query Processor
    • Labels:
      None

      Activity

      Hide
      Carl Steinbach added a comment -

      "SELECT MAX(p) FROM empty" should return NULL, but instead it returns an empty result set:

      hive> CREATE TABLE empty (c INT) PARTITIONED BY (p INT);
      hive> SELECT MAX(c) FROM empty;
      NULL
      hive> SELECT MAX(p) FROM empty;
      
      hive> ALTER TABLE empty ADD PARTITION (p=1);
      hive> SELECT MAX(p) FROM empty;
      1
      hive>
      
      Show
      Carl Steinbach added a comment - "SELECT MAX(p) FROM empty" should return NULL, but instead it returns an empty result set: hive> CREATE TABLE empty (c INT) PARTITIONED BY (p INT); hive> SELECT MAX(c) FROM empty; NULL hive> SELECT MAX(p) FROM empty; hive> ALTER TABLE empty ADD PARTITION (p=1); hive> SELECT MAX(p) FROM empty; 1 hive>
      Hide
      Shreepadma Venugopalan added a comment -

      SQL standard dictates that the return value should be NULL. However, HiveQL seems to deviate and return an empty result set for other aggregate functions as well. This needs to be fixed to achieve parity with the SQL standard.

      Show
      Shreepadma Venugopalan added a comment - SQL standard dictates that the return value should be NULL. However, HiveQL seems to deviate and return an empty result set for other aggregate functions as well. This needs to be fixed to achieve parity with the SQL standard.
      Hide
      Ashutosh Chauhan added a comment -

      +1 will commit if tests pass.

      Show
      Ashutosh Chauhan added a comment - +1 will commit if tests pass.
      Hide
      Ashutosh Chauhan added a comment -

      Committed to trunk. Thanks, Zhenxiao!

      Show
      Ashutosh Chauhan added a comment - Committed to trunk. Thanks, Zhenxiao!
      Hide
      Hudson added a comment -

      Integrated in Hive-trunk-h0.21 #1845 (See https://builds.apache.org/job/Hive-trunk-h0.21/1845/)
      HIVE-2794 : Aggregations without grouping should return NULL when applied to partitioning column of a partitionless table (Zhenxiao Luo via Ashutosh Chauhan) (Revision 1418848)

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

      • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/MapOperator.java
      • /hive/trunk/ql/src/test/queries/clientpositive/partInit.q
      • /hive/trunk/ql/src/test/results/clientpositive/metadataonly1.q.out
      • /hive/trunk/ql/src/test/results/clientpositive/partInit.q.out
      Show
      Hudson added a comment - Integrated in Hive-trunk-h0.21 #1845 (See https://builds.apache.org/job/Hive-trunk-h0.21/1845/ ) HIVE-2794 : Aggregations without grouping should return NULL when applied to partitioning column of a partitionless table (Zhenxiao Luo via Ashutosh Chauhan) (Revision 1418848) Result = FAILURE hashutosh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1418848 Files : /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/MapOperator.java /hive/trunk/ql/src/test/queries/clientpositive/partInit.q /hive/trunk/ql/src/test/results/clientpositive/metadataonly1.q.out /hive/trunk/ql/src/test/results/clientpositive/partInit.q.out
      Hide
      Hudson added a comment -

      Integrated in Hive-trunk-hadoop2 #54 (See https://builds.apache.org/job/Hive-trunk-hadoop2/54/)
      HIVE-2794 : Aggregations without grouping should return NULL when applied to partitioning column of a partitionless table (Zhenxiao Luo via Ashutosh Chauhan) (Revision 1418848)

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

      • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/MapOperator.java
      • /hive/trunk/ql/src/test/queries/clientpositive/partInit.q
      • /hive/trunk/ql/src/test/results/clientpositive/metadataonly1.q.out
      • /hive/trunk/ql/src/test/results/clientpositive/partInit.q.out
      Show
      Hudson added a comment - Integrated in Hive-trunk-hadoop2 #54 (See https://builds.apache.org/job/Hive-trunk-hadoop2/54/ ) HIVE-2794 : Aggregations without grouping should return NULL when applied to partitioning column of a partitionless table (Zhenxiao Luo via Ashutosh Chauhan) (Revision 1418848) Result = ABORTED hashutosh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1418848 Files : /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/MapOperator.java /hive/trunk/ql/src/test/queries/clientpositive/partInit.q /hive/trunk/ql/src/test/results/clientpositive/metadataonly1.q.out /hive/trunk/ql/src/test/results/clientpositive/partInit.q.out

        People

        • Assignee:
          Zhenxiao Luo
          Reporter:
          Carl Steinbach
        • Votes:
          0 Vote for this issue
          Watchers:
          3 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Development