Support Questions

Find answers, ask questions, and share your expertise

Connecting hive - Beeline vs hive?

avatar
Contributor

I am new to this so just want to understand how this works. If I connect using hive using beeline on command prompt,and then look at the available databases (show databases), I see a different set from what I get if I connect typing hive directly from the edge node.

Can someone please explain why these are different.

1 ACCEPTED SOLUTION

avatar
Super Collaborator

Hello,

You'll find some useful information on: https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.4.2/bk_dataintegration/content/beeline-vs-hive-...

Essentially beeline would use the JDBC/Thrift (or alternatively HTTP) protocol to communicate with HiveServer2.

HiveServer2 then handles the hive logic (finding the table definition in the metastore, reading the data from HDFS, etc).

On the other hand, the hive shell access directly the Hive metastore and HDFS data, and bypasses HiveServer2.

The big influence that this difference can have in your situation is security.

Hive security is implemented in HiveServer2, thus Hive shell bypasses any Hive access policies you might have set on specific databases using Ranger or SQL based authorization (only HDFS policies apply in this case).

View solution in original post

10 REPLIES 10

avatar
Master Guru

@Khera good question. I have asked it here.