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

Sergey Shelukhin commented on HIVE-15397:
-----------------------------------------

Interesting q file changes.. according to our take on 1=1 group by 1=1 they are 
correct.
E.g. table has 3 partitions, part=a, part=b, and part=c. Only a and c have data.
select distinct part from t
used to return "a, b, c". However, there are no rows in the table that actually 
have value b. So, the result has changed to "a, c".
[~ashutoshc] [~jcamachorodriguez] would you say it's the correct change and 
previous result is incorrect?
Same for max(partcol) from an empty table - should it be null? Cause there are 
no rows in the table to derive max from, similar how there are no rows in gby 
1=1 to group by.

> metadata-only queries may return incorrect results with empty tables
> --------------------------------------------------------------------
>
>                 Key: HIVE-15397
>                 URL: https://issues.apache.org/jira/browse/HIVE-15397
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Sergey Shelukhin
>            Assignee: Sergey Shelukhin
>         Attachments: HIVE-15397.patch
>
>
> Queries like select 1=1 from t group by 1=1 may return rows, based on 
> OneNullRowInputFormat, even if the source table is empty. For now, add some 
> basic detection of empty tables and turn this off by default (since we can't 
> know whether a table is empty or not based on there being some files, without 
> reading them).



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

Reply via email to