I did not quite understand that the examples from the documentation were adequate, so I tried to answer.
In the beginning there was only --hiveconf , and the replacement of variables did not exist.
The --hiveconf parameter allowed users to set hive configuration values from the command line and thatโs it. All hive configuration values โโare stored in the hiveconf namespace, i.e. hiveconf:mapred.reduce.tasks . These values โโallowed you to control things like the number of cards and reducers if status messages should be displayed, and if the script should continue on error.
Later a replacement was added. This meant that you can now use variables in queries with the syntax ${...} . However, the only variables you could set from the command line were in the hiveconf namespace using --hiveconf so that users put their variables.
Putting your personal variables in the Hive configuration namespace will probably not break anything, but it is also not a very good form. It was later suggested that the hivevar namespace be added specifically for custom variables, which could also be defined on the command line with --hivevar . This meant a cleaner separation between hive configuration values โโand user variables.
In short:
The hiveconf and --hiveconf should be used to set the Hive configuration values.
The hivevar and --hivevar should be used to define custom variables.
Setting custom variables in the hiveconf namespace hiveconf probably not break anything, but is not recommended.
Mr. Llama Jan 26 '17 at 18:08 2017-01-26 18:08
source share