Hari Sekhon created HIVE-10398:
----------------------------------
Summary: Variables to raise errors on select from non-existent or
empty partitions rather than just return 0 rows
Key: HIVE-10398
URL: https://issues.apache.org/jira/browse/HIVE-10398
Project: Hive
Issue Type: New Feature
Components: Query Processor
Affects Versions: 0.14.0
Environment: HDP 2.2
Reporter: Hari Sekhon
Priority: Minor
Feature request to add 2 new variables to raise errors on queries that select
from empty or non-existent partitions, eg:
{code}set hive.error.select.non-existent.partition=true;
SELECT * FROM myTable WHERE date='2015-02-29';
<raise some error here>
{code}
Currently the behaviour is to return success with zero rows, which doesn't make
practical sense in many cases, and I only detected this because my bulk jobs
started completing too quickly. I work around this now by listing all
partitions and then checking against that before launching the bulk job but it
would be more convenient to have the query just fail as is logical in these
sorts of scenarios.
There should also be a similar variable for selecting from empty partitions for
people who expect their partitions to be populated (a very common expectation),
such as:
{code}hive.error.select.empty.partition{code}
This is somewhat similar to the existing variable
{code}hive.error.on.empty.partition{code}
except this existing one only covers dynamic partition inserts that generate
empty partitions, so the suggested query side variable would be a logical
counterpart to that.
Having these variables as 'false' by default these would make these completely
backwards compatible improvements.
Hari Sekhon
http://www.linkedin.com/in/harisekhon
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)