![Sort By vs Order By vs Group By vs Cluster By in Hive]/assets/uploads/2015/01/images.jpg)

What is Hive Strict Mode?

Hive Strict Mode (hive.mapred.mode=strict) enables Hive to restrict certain performance intensive operations. Such as:

  • It restricts queries of partitioned tables without a WHERE clause.
hive> set hive.mapred.mode=strict;

hive> SELECT s.name, s.class FROM students s LIMIT 100;

FAILED: Error in semantic analysis: No partition predicate found for

Alias "s" Table "students"

hive> set hive.mapred.mode=nonstrict;

hive> SELECT s.name, s.class FROM students s LIMIT 100;
  • It restricts ORDER BY operation without a LIMIT clause (since it uses a single reducer which can choke your processing if not handled properly).

Also for dynamic partitions:

hive.exec.dynamic.partition.mode=strict

This is a default setting and prevents all partitions to be dynamic and requires at least one static partition.