Got it

Can I run unix shell commands from Hive?

Created: Jan 10, 2020 03:12:42Latest reply: May 25, 2022 02:40:58 2156 8 2 0 0
  Rewarded HiCoins: 0 (problem resolved)

Hi team,

Please give me an example of UNIX shell commands from Hive.

This is my problem, can anyone help me? Thank you!


  • x
  • convention:

Featured Answers
little_fish
Admin Created Jan 10, 2020 03:23:45

Dear @Phany, 

Yes, unix shell commmand works for Hive, use the ! mark just before the command.

For example !pwd at hive prompt will list the current directory.

I hope I can help you!


View more
  • x
  • convention:

All Answers
little_fish
little_fish Admin Created Jan 10, 2020 03:23:45

Dear @Phany, 

Yes, unix shell commmand works for Hive, use the ! mark just before the command.

For example !pwd at hive prompt will list the current directory.

I hope I can help you!


View more
  • x
  • convention:

Phany
Phany Created Jan 10, 2020 03:31:30

Posted by little_fish at 2020-01-10 03:23 Dear @Phany, Yes, unix shell commmand works for Hive, using the ! mark just before the command.For ...

hi friend,

How can I do this from a shell script and send the output to a txt file and then send that txt file as an attachment in an email.

SELECT count(*) from pds_table > a.txt;

Thanks.

View more
  • x
  • convention:

little_fish
little_fish Admin Created Jan 10, 2020 03:34:38

@Phany

hive -e 'SELECT count(*) from pds_table' > a.txt

We warmly remind you that command, thanks.

View more
  • x
  • convention:

Phany
Phany Created Jan 10, 2020 03:35:38

thanks
View more
  • x
  • convention:

Ramu
Ramu Created Mar 26, 2020 16:14:06

While I am running this command, I am getting this error.

hive -beeline 'show databases' >a.txt

Error:
You are suggested to to switch to Beeline from CLI, meanwhile Hive CLI will soon be deprecated in favor of Beeline.

What is the solution

View more
  • x
  • convention:

little_fish
little_fish Created May 30, 2022 09:08:24 (0) (0)
https://cwiki.apache.org/confluence/display/Hive/Replacing+the+Implementation+of+Hive+CLI+Using+Beeline
Please see this config.  
Suhail
Suhail Created May 24, 2022 21:15:08

Good answer
View more
  • x
  • convention:

Saqibaz
Saqibaz Created May 25, 2022 02:40:58

Good Answer
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.
Information Protection Guide
Thanks for using Huawei Enterprise Support Community! We will help you learn how we collect, use, store and share your personal information and the rights you have in accordance with Privacy Policy and User Agreement.