It seems that the main intention of those who ask is to have short commands, without bureaucracy. Responding to this type of intention: create an alias for each long and frequently used command.
Good to remember that commands of the type beeline
and hive
are executed with each user’s desired permissions and settings, in particular the JDBC connection string defines which Hive service to use and the Queue define which queue (Yarn) to use.
In a usual Hadoop cluster users are created on an edge server, where each one is "owner of their piece", and can at least create their own command names. Despite all the diversity of the Linux world, it is also common for the environment to accept the file .bashrc
.
I strongly suggest editing this file with the desired aliases, for example:
alias bl="beeline -u jdbc:hive2://aaats879454co.sistema.br:10000/sistema tez.queue.name=Desenvolvedores -n usuario01";
alias bl_exe='beeline -u "jdbc:hive2://aaats879454co.sistema.br:10000/sistema" tez.queue.name=Desenvolvedores -n usuario01 -e';
alias bl_exe_csv='beeline -u "jdbc:hive2://aaats879454co.sistema.br:10000/sistema" tez.queue.name=Desenvolvedores -n usuario01 --silent=true --outputformat=dsv --delimiterForDSV=";" -e';
Then Voce can run without bureaucracy in the terminal:
bl # comando que simplesmente entra no modo interativo do Beeline
bl_exe "show databases" # fica no terminal e gera o show tables
bl_exe "SELECT 1+1" # fica no terminal e gera resultado de query
bl_exe_csv "SELECT 123 AS x UNION ALL SELECT 456" > lixo.csv # resultado de query em CSV