Hive properties are configuration settings that control the behavior of the Hive runtime. They can be set at various levels, including the system level, the Hive server level, and the session level. Here are two common ways to set Hive properties:
- SET command: You can set Hive properties at the session level using the SET command in the Hive CLI or in a Hive script. For example, SET hive.execution.engine=tez; sets the execution engine to Tez for the current session. You can also use SET -v; to display a list of all currently set properties and their values.
- hiverc file: You can set Hive properties at the Hive CLI level by creating a .hiverc file in your home directory or in the directory from which you launch the Hive CLI. The .hiverc file is a script that is automatically executed when you start the Hive CLI, and it can contain SET commands or other Hive statements. For example, you could add SET hive.execution.engine=tez; to your .hiverc file to set the execution engine to Tez every time you start the Hive CLI.
By setting Hive properties, you can control various aspects of the Hive runtime, such as the execution engine, the input/output formats, the compression codecs, and the partitioning behavior, among others. Hive properties can also be used to customize the behavior of Hive functions, UDFs, and SerDes, as well as to manage resources, such as memory, parallelism, and scheduling.