Questions tagged [beeline]

Beeline is a Hive command-line shell that works with HiveServer2

Beeline replaces Hive CLI for Hiveserver. Documentation is available here.

The Beeline shell works in both embedded mode as well as remote mode. In the embedded mode, it runs an embedded Hive (similar to Hive CLI) whereas remote mode is for connecting to a separate HiveServer2 process over Thrift. Starting in Hive 0.14, when Beeline is used with HiveServer2, it also prints the log messages from HiveServer2 for queries it executes to STDERR. Remote HiveServer2 mode is recommended for production use, as it is more secure and doesn't require direct HDFS/metastore access to be granted for users.

There’s detailed documentation of SQLLine which is applicable to Beeline as well.

281 questions
26
votes
3 answers

Showing tables from specific database with Pyspark and Hive

Having some databases and tables in them in Hive instance. I'd like to show tables for some specific database (let's say 3_db). +------------------+--+ |  database_name   | +------------------+--+ | 1_db            | | 2_db            | | 3_db  …
Keithx
  • 2,994
  • 15
  • 42
  • 71
24
votes
5 answers

Export as csv in beeline hive

I am trying to export my hive table as a csv in beeline hive. When I run the command !sql select * from database1 > /user/bob/output.csv it gives me syntax error. I have successfully connected to the database at this point using the below command.…
Defcon
  • 807
  • 3
  • 15
  • 36
21
votes
7 answers

Connecting to Hive using Beeline

I am trying to connect to hive installed in my machine through Beeline client. when I give the 'beeline' command & connect to Hive, the client is asking for user name & password !connect jdbc:hive2://localhost:10000/default I have no idea what is…
Raj
  • 2,368
  • 6
  • 34
  • 52
17
votes
6 answers

How to quit beeline?

I am using CDH 5.5 and need to use beeline. I am pretty new to it and learning it now. I can start beeline but cannot quit as we do in Hive. I need to use Ctrl+z to quit which is not the proper way. Can someone help?
user4503253
14
votes
1 answer

How to print hive beeline output without header and non tabular form

I want to print this output +------------------------------------------------+--+ | tab_name | +------------------------------------------------+--+ | table1 | | table2 …
sande
  • 567
  • 1
  • 10
  • 24
14
votes
2 answers

What is the hive command to see the value of hive.exec.dynamic.partition

We know that set command is used to set some values for properties hive> SET hive.exec.dynamic.partition=true; hive> SET hive.exec.dynamic.partition.mode=non-strict; But how do we read the current value of above property I tried the below…
Surender Raja
  • 3,553
  • 8
  • 44
  • 80
13
votes
2 answers

AuthorizationException: User not allowed to impersonate User

I wrote a spark job which registers a temp table and when I expose it via beeline (JDBC client) $ ./bin/beeline beeline> !connect jdbc:hive2://IP:10003 -n ram -p xxxx 0: jdbc:hive2://IP> show…
Nirmal Ram
  • 1,180
  • 2
  • 9
  • 18
10
votes
1 answer

Avoid printing table name in column name while using beeline

While using hive in beeline an using simple select query I would like to return table without table name in column name as a default. Example Data On example of a simple table (TutorialsPoint): CREATE TABLE IF NOT EXISTS employee ( eid int, name…
Konrad
  • 17,740
  • 16
  • 106
  • 167
9
votes
2 answers

Cannot connect to hive using beeline, user root cannot impersonate anonymous

I'm trying to connect to hive using beeline !connect jdbc:hive2://localhost:10000 and I'm being asked for a username and password Connecting to jdbc:hive2://localhost:10000' Enter username for jdbc:hive2://localhost:10000: Enter password for…
sergio.nava
  • 175
  • 2
  • 14
9
votes
2 answers

Is it possible to install Beeline to run Hive queries without installing Hive?

I'm on a Mac OSX machine and I'd like to run queries against a Hadoop db on a CentOS 6.6 machine. I can log in to the CentOS machine and run hive queries there. But I need to be able to run queries from my machine to troubleshoot connection issues.…
jcollum
  • 43,623
  • 55
  • 191
  • 321
6
votes
2 answers

Hive permission denied for user anonymous using beeline shell

I created a 3 node Hadoop cluster with 1 namenode and 2 datanode. I can perform a read/write query from Hive shell, but not beeline. I found many suggestions and answers related to this issue. In every suggestion it was mentioned to give the…
sachin
  • 379
  • 3
  • 16
6
votes
1 answer

Hiveserver2 failed to open new session in beeline

I'm running hive 2.1.1, hadoop 2.7.3 on Ubuntu 16.04. ps aux | grep hive shows that hiveserver2 is running. I'm trying to login with user [hive2] and password [password] to hivesever2 through beeline. Here is my beeline output: beeline> !connect…
Top.Deck
  • 1,077
  • 3
  • 16
  • 31
5
votes
1 answer

Beeline-Hive returns CSV with blank rows on top of data

My script does simple job, run SQL from a file and save to CSV. Code is up and running but there is odd behaviour while producing CSV output. Data starts at around line 70, rather then from very beginning in the CSV file. #!/bin/bash beeline -u…
marcin2x4
  • 1,321
  • 2
  • 18
  • 44
5
votes
2 answers

hive is not allowed to impersonate hive

I have a hadoop cluster configured with hadoop 2.7.2 and hive 2.1.0. I am using beeline to connect to hive with the following command: beeline beeline> !connect jdbc:hive2://localhost:10000 Enter username for jdbc:hive2://localhost:10000: At first,…
Heyang Wang
  • 360
  • 2
  • 4
  • 19
4
votes
0 answers

beeline spool Hive puts special character instead of quote

I am exporting query results form hive using beeline, here is my command : beeline -u 'jdbc:hive2://myhost.com:10000/mydb;principal=hive/myhost.COM' --incremental=true --silent=true --outputformat=dsv --disableQuotingForSV=true…
Thelight
  • 359
  • 1
  • 5
  • 15
1
2 3
18 19