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

Ashutosh Chauhan commented on HIVE-15397:
-----------------------------------------

This is interesting, because Hive allows you to create partitions without any 
data. That will result in a partitioning column having a value. So, shall we 
assume that table has row(s) with partitioning column taking supplied value and 
other columns being null. I think no. This was the case earlier and I think its 
wrong. I think behavior we are getting now is correct. If partition exists but 
its empty, we should consider partition has 0 rows, thus value for partitioning 
column should not matter during query evaluation. So, max(partCol) from 
empty_table should be null even when there is a partition which has partcol = 1.
So, I think behavior we are getting after patch is correct and desired. 

> 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.01.patch, 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