Different behaviors between Ine and Ive-e

Asked

Viewed 99 times

1

In command execution using Beeline connection always works, but with Hive-e it does not work.

That’s how it works:

beeline -u jdbc:hive2://aaats879454co.sistema.br:10000/sistema tez.queue.name=Desenvolvedores -n usuario01 -e "show databases";

But that doesn’t work:

hive -e "show databases";

2 answers

0

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

0

For the version of Hive 1.1.0 the execution worked correctly.

Important to know your Hive version, so run it:

Hive-version

It may be that Hive’s service is in trouble.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.