2

I would like to know one thing in hive dynamic partition. While doing dynamic partitions we have to set following properties

SET hive.exec.dynamic.partition = true;

SET hive.exec.dynamic.partition.mode = nonstrict;

Without those properties we can't do a dynamic partition.

I want to know why these are required? Can someone tell me why we need to set this properties.

leftjoin
  • 36,950
  • 8
  • 57
  • 116

1 Answers1

0

It was done as additional protection measure against partitions being unintentionally overwritten.

Docs says:

Another situation we want to protect against dynamic partition insert is that the user may accidentally specify all partitions to be dynamic partitions without specifying one static partition, while the original intention is to just overwrite the sub-partitions of one root partition. We define another parameter hive.exec.dynamic.partition.mode=strict to prevent the all-dynamic partition case. In the strict mode, you have to specify at least one static partition. The default mode is strict. In addition, we have a parameter hive.exec.dynamic.partition=true/false to control whether to allow dynamic partition at all. The default value is false prior to Hive 0.9.0 and true in Hive 0.9.0 and later

leftjoin
  • 36,950
  • 8
  • 57
  • 116