[ 
https://issues.apache.org/jira/browse/HIVE-13452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15231060#comment-15231060
 ] 

Pengcheng Xiong commented on HIVE-13452:
----------------------------------------

mysql
{code}
Database changed
mysql> create table t1 (a int);
Query OK, 0 rows affected (0.02 sec)

mysql> select count(1) from t1 group by 1;
ERROR 1056 (42000): Can't group on 'count(1)'
mysql> select count(1) from t1;
+----------+
| count(1) |
+----------+
|        0 |
+----------+
1 row in set (0.00 sec)
{code}

> StatsOptimizer should return no rows on empty table with group by
> -----------------------------------------------------------------
>
>                 Key: HIVE-13452
>                 URL: https://issues.apache.org/jira/browse/HIVE-13452
>             Project: Hive
>          Issue Type: Bug
>          Components: Logical Optimizer
>            Reporter: Ashutosh Chauhan
>            Assignee: Pengcheng Xiong
>
> {code}
> create table t1 (a int);
> analyze table t1 compute statistics;
> analyze table t1 compute statistics for columns;
> select count(1) from t1 group by 1;
> set hive.compute.query.using.stats=true;
> select count(1) from t1 group by 1;
> {code}
> In both cases result set should be empty. However, with statsoptimizer on 
> Hive returns one row with value 0.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to