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

How to count number of working days excluding holiday in Hive?

I am able to find difference between two dates in MySQL however same query is not working in hive. I have a table in which we have a list of dates of holidays. SELECT bd.*, (SELECT COUNT(*) FROM holiday WHERE h_date BETWEEN bd.t_date AND…
1
vote
2 answers

Extract hive count string using regex

I am trying to get total number of records in a hive table using paramiko. I know we can use Pyhive or pyhs2 but it requires certain configuration and it will take alot of time to get that done from my IT team. So I am using paramiko to execute the…
satish silveri
  • 358
  • 3
  • 17
1
vote
2 answers

Beeline - No current connection - Default hs2 connection config nout found

We are facing an issue with respect to beeline CLI in one of our cloudera cluster. We are trying to connect and execute hql files which are alter statements using beeline CLI as like below and it is failing with the following…
Basavaraju B K
  • 71
  • 2
  • 11
1
vote
1 answer

AWS EMR: Spark - SparkException java IOException: Failed to create local dir in /tmp/blockmgr*

I have a AWS EMR cluster with Spark. I can connect to it (spark): from master node after SSHing into it from another AWS EMR cluster But NOT able to connect to it: from my local machine (macOS Mojave) from non-emr machines like Metabase and…
user954311
  • 41
  • 3
1
vote
1 answer

How to use hive variable substitution rightly

When I'm using variable substitution in hive, I meet some errors, but I need your help. My code: set hievar:b='on t1.id=t2.id where t2.id is null'; select * from t_old as t1 full outer join t_new as t2 ${b}; when I run this code in hive shell, it…
BlackMamba
  • 10,054
  • 7
  • 44
  • 67
1
vote
0 answers

Beeline - Hive - how to remove additional (not needed) quotes?

I am using Beeline to connect from one server to another and get data from Hive. Command that I use is: beeline --outputformat=tsv2 --silent -e 'select * from t1 limit 3' Output is: a "{""col1"": ""123"" } " b "{""col1"": ""234"" } " c …
Joe
  • 11,983
  • 31
  • 109
  • 183
1
vote
2 answers

Store output results of Hive query via beeline in a string. tried running with Popen as well but did not work

I am running a hive query from Python script. I was able to run it with out any issue when i used subprocess.getstatusoutput, but unable to store the result into a variable. So i tried to do with Popen, i get an error saying unable to dd1 =…
Hari
  • 31
  • 1
  • 7
1
vote
1 answer

Why do we use the Hive service principal when using beeline to connect to Hive on a Kerberos enabled EMR cluster?

I am trying to connect to Hive using beeline on an EMR cluster (Kerberos enabled) and am wondering why I'd run a kinit (using my user account) and then the following: beeline -u "jdbc:hive2://localhost:10000/default;principal=hive/_HOST@REALM" The…
Brandon
  • 375
  • 2
  • 16
1
vote
1 answer

Hive Concat function not working in Beeline

${beeline_url} --silent=true --showHeader=false --outputformat=csv2 --showWarnings=false -e "select concat('invalidate metadata ', trim(table_name) , '; refresh ', trim(table_name) ,';') from my_Table " > /home/table_list.csv I'm trying to run this…
1
vote
0 answers

How to instal Beeline (Hive client) on a new RHEL server?

I got a new server in the company and trying to figure out how to install Beeline without installing whole Hadoop package.. Tried following https://www.cloudera.com/documentation/enterprise/5-8-x/topics/cdh_ig_hive_jdbc_install.html with sudo yum…
Joe
  • 11,983
  • 31
  • 109
  • 183
1
vote
1 answer

How can I make my pyspark database visible to beeline on windows?

Hey All, I need some help to open a pickle jar in pyspark. I'm learning pyspark and as an exercise I'm trying to do something that I assumed would be a simple thing... but its giving me a very hard time. So let's start with what I'm doing. I'm…
costargc
  • 516
  • 5
  • 14
1
vote
0 answers

Error: Error while compiling statement: FAILED: SemanticException Error when getting current notification event ID (state=42000,code=40000)

I am exporting a hive table to hdfs using beeline,I am getting error as Error: Error while compiling statement: FAILED: SemanticException Error when getting current notification event ID (state=42000,code=40000)"
1
vote
0 answers

why my beeline automation script not loading data to history hive table?

I have a shell script that automates the beeline utility to do below things: Truncate the staging table Load the data to the staging table append the history table. So far so good. My code is Truncating and loading the data to the stating table, but…
learner
  • 73
  • 2
  • 9
1
vote
0 answers

Hive Beeline outputs ^M and null char

I want to get the output from a Hive query running beeline. For some reasons, I get ^M and "null" char along with expected results. beeline -u jdbc:hive2://server:10000/default --showHeader=false --outputformat=csv2 --silent=true…
CLO
  • 103
  • 8
1
vote
2 answers

Show table doesn't show all tables in hive

I am using beeline to list all existing hive tables on our cluster: c724199@analytics-01] ~ > beeline -u "jdbc:hive2://blah_blah_blah" WARNING: Use "yarn jar" to launch YARN applications. Beeline version 1.2.1000.2.4.2.0-258 by Apache…
Mat
  • 27
  • 1
  • 8