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
1
vote
1 answer

Beeline not working with subprocess.run in python, getting stuck forever

I am trying to connect thru beeline from Python script and run hql script. I am unable to run with subprocess.run or subprocess.popen. i am able to run it directly on command…
user3495160
  • 175
  • 1
  • 3
  • 19
1
vote
1 answer

Redirect the table generated from Beeline to text file without the grid (Shell Script)

I am currently trying to find a way to redirect the standard output from beeline shell to text file without the grid. The biggest problem I am facing right now is that my columns have negative values and when I'm using regex to remove the '-', it is…
Vin
  • 177
  • 3
  • 11
1
vote
0 answers

configure pyhive from beeline

I'm on a machine where beeline exists and works with the command beeline -u "jdbc:hive2://bdm05:10000/test;principal=hive/_HOST@BIGDATA-INT" -n myuser I would need to use python and pyhive in order to handle tables with pandas. from pyhive import…
DPColombotto
  • 159
  • 1
  • 3
  • 11
1
vote
1 answer

Export hql output to csv in beeline

I am trying to export my hql output to csv in beeline using below command : beeline -u "jdbc:hive2://****/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2"?tez.queue.name=devices-jobs --outputformat=csv2 -e "use schema_name; select *…
zxcv
  • 79
  • 1
  • 6
1
vote
2 answers

how to run beeline and hive query from a bash shell script

I am able to run below steps manually in order after logging in to unix bash shell. echo "Connecting beeline" beeline !connect…
Rohit
  • 97
  • 1
  • 2
  • 9
1
vote
0 answers

Airflow could not find beeline

I have an airflow dag that uses beeline to execute queries. Everything was working well,then system has to reboot due to blackout. After that airflow couldn't connect to beeline. The error says [Errno 2] No such file or directory: 'beeline':…
Bommu
  • 229
  • 1
  • 4
  • 14
1
vote
1 answer

Get an accurate return code from beeline when using an HQL file?

I have an init file and a HQL file that I am passing to beeline to execute: beeline -i "$INIT_FILE" -f "$BEELINE_HQL_FILE" And I want beeline to stop executing the script and return an error code if there are any lines in the script that…
Jared DuPont
  • 165
  • 2
  • 14
1
vote
1 answer

Hive beeline conversion to Google Dataproc

What will be the google cloud equivalent of --showHeader and --outputformat in Hive Beeline command. I have the following query: beeline -u $BEELINE_URL --showHeader=false --outputformat=vertical \ -e "select count(*) from db.table" ; I need to…
1
vote
1 answer

Hive CSV cannot be imported in Pandas

I am dumping some Hive output into a csv using the pretty standard: beeline -f my_script.hql --output_format=csv2 > data.csv However this file does not seem to be proper CSV: It cannot be read by unix systems $ file data.csv data.csv data It…
pilu
  • 720
  • 5
  • 16
1
vote
0 answers

Logging all hive sql statements as the execute from one .hql file

I have one .hql with multiple hive sql statements that I am executing via beeline hive in a .sh file. Is there anyway to print the sql statements to the logs as they execute? I tried modifying some of the hive log settings in the beeline command but…
1
vote
0 answers

beeline cant connect passing a init script from hdfs

It's possible initialize the connection with Hive passing a init script from HDFS? I tried beeline -u <> -i wasb://, the connection is estabelished but the script initiliazation fails with 'no such file or directory', but…
Lucas Maraal
  • 39
  • 10
1
vote
1 answer

How to send beeline output to sqoop

I am struggling to send beeline output to apache sqoop tool. I guess Apache sqooop can read data from where data sits on Hadoop cluster.But beeline can query data and output the data into where hadoop client is running. Is it possible to send…
UtpMahesh
  • 410
  • 10
  • 25
1
vote
1 answer

Spark Thrift beeline: Required field 'client_protocol' is unset

I started Spark Thrift Server within HDP 3.1. I tried to connect to it via beeline: beeline -u "jdbc:hive2://myhost.mybank.rus:10016/public" And I got error: 19/10/10 00:17:08 [main]: ERROR jdbc.HiveConnection: Error opening session …
Pavel
  • 424
  • 3
  • 12
1
vote
1 answer

Job name for Tez job in beeline and view it in YARN

I'm using Beeline and like to set a specific name for a TEZ job, like I use mapreduce.job.name for a MapReduce job. I tried hive.query.name, but it doesn't make any difference in yarn application -list. Some say we can view the name only in TEZ UI,…
ram_23
  • 79
  • 11
1
vote
1 answer

How to pass beeline hive var for source command?

I am trying to pass beeline variable. source file name command is not able to replace the variable with the value. Same command working using hive -f.Please find commands below. Note: cat >dev_env.hql set…
user3858193
  • 1,320
  • 5
  • 18
  • 50