Reputation: 780
we have a HIVE table that is partitioned by date, we want end user to always use where clause in the query, if they are not using it, it should throw exception.
Is there any setting in HIVE, that could enforce it?
Upvotes: 0
Views: 809
Reputation: 44921
hive.metastore.limit.partition.request
- Default value: -1
- Added In: Hive 2.2.0 with HIVE-13884
This limits the number of partitions that can be requested from the Metastore for a given table. A query will not be executed if it attempts to fetch more partitions per table than the limit configured. A value of "-1" means unlimited. This parameter is preferred over hive.limit.query.max.table.partition (deprecated).
Let your users access the data through views, e.g. -
create view mytable_last_year
as
select *
from mytable
where dt >= add_months(current_date,-12)
;
Upvotes: 2