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
2
votes
3 answers

Quoting csv output with beeline

I am trying to get a quoted csv output from beeline. My query looks like: beeline -u 'jdbc:hive2://localhost:10000/' --outputformat=csv2 -e 'set system:disable.quoting.for.sv=false; select 1 as a, 2 as b' I expect as output "a","b" "1","2" But…
Guillaume
  • 2,325
  • 2
  • 22
  • 40
2
votes
1 answer

Hive Insert - Failed with exception Unable to alter table. java.lang.NullPointerException

We are using Cloudera 5.6. We have configured Sentry for Hive. Whenever we issue an insert statment, it fails with the below exception. But when we check the table, the row is inserted properly. We have set all the permissions to hive. $$$ insert…
user3198755
  • 477
  • 2
  • 10
  • 21
2
votes
1 answer

How does Hive CLI retrieve huge result files from HDFS?

After I execute a hive query via CLI like below: $ hive -e QUERY > output.txt Hive client will compile the QUERY and send it to Hadoop cluster. Hadoop executes some jobs and outputs result to a file (assume only 1 reducer) at HDFS. Then Hive…
kuang
  • 687
  • 1
  • 6
  • 17
2
votes
3 answers

Hive Current date function

I want to get the current date in beeline. I tried to use this: FROM_UNIXTIME(UNIX_TIMESTAMP()) it outputs this: 16-03-21 What I was looking to get it: 2016-03-21 09:34 How do I do it? I see the beeline documentation…
banditKing
  • 9,405
  • 28
  • 100
  • 157
1
vote
0 answers

hive issue when activating yarn FairScheduler

After activating yarn FairScheduler, i am note able to run beeline hive, i have this error on hiveserver2 :java.lang.NoSuchMethodError: org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.AllocationFileLoaderService: method ()V not…
1
vote
1 answer

Unable to select count of rows of an ORC table through Hive Beeline command

I am using the following components - Hadoop 3.1.4 , Hive 3.1.3 and Tez 0.9.2 And there is an ORC table from which I am trying to extract count of the rows in the table. select count(*) from ORC_TABLE and this throws the below set of…
Afroz Baig
  • 36
  • 5
1
vote
1 answer

Why does airflow's have (beeline) become stuck?

The error does not appear as shown below, but the operation stops in this state. So, if I directly access the beeline and enter the same sql statement and execute it, it works. What's the problem? Reading local file:…
SecY
  • 307
  • 4
  • 12
1
vote
1 answer

How to select all column except few in beeline connection query

As we all know we can exclude column and selecting all other columns, set hive.support.quoted.identifiers=none; select (col_21)?+.+ from But, My questions how to use it beeline connection execution beeline -e When I tried , I got an…
Girish HM
  • 11
  • 1
1
vote
1 answer

beeline can connect to jdbc:hive2:// but cannot connect to jdbc:hive2://localhost:10000

I am struggling with beeline connection to hive server. On my server (with name Sun, all the operation on this server), In the hive folder, I can start beeline as ./bin/beeline and then connect to hive: !connect jdbc:hive2://, then I am…
XYZ
  • 352
  • 5
  • 19
1
vote
1 answer

Create a table in hive with timestamp as comment

I would like to create a table in hive, inside the comment include the creation date (current_timestamp function). Something like this: CREATE TABLE IF NOT EXISTS ex.tb_test ( field1 int, field2 String) COMMENT current_timestamp STORED AS…
1
vote
0 answers

Spark job failed due to "Could not execute broadcast in 300 secs."

My scheduled job excuted everyday at 2:20 AM, but it occasionally failed. Beeline log in spark is shown below. 21/02/10 02:20:27 INFO DAGScheduler: ResultStage 14825 ($anonfun$withThreadLocalCaptured$1 at FutureTask.java:266) failed in 299.939 s due…
Edye Chan
  • 404
  • 5
  • 7
1
vote
1 answer

how to remove ADD jar statement in the start of beeline

How can I remove statement that happened when beeline terminal start? I have AD jar statement by default when I start beeline and I don't have this jar which case error message : ADD JAR…
Omer Anisfeld
  • 1,236
  • 12
  • 28
1
vote
1 answer

How to print output file size when use hive export data with command "insert overwrite directory"

I am using beeline to export data to hdfs with command: INSERT OVERWRITE DIRECTORY $export_tmp ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.MultiDelimitSerDe' select * from xxx_table_name; I want to set echo output file size such…
rilweic
  • 51
  • 1
  • 5
1
vote
1 answer

How to load data from CSV to Hive external table (Avro format)?

I try to build a beeline script to load a CSV file stored in HDFS to an external table in Hive. First I create an empty external table: CREATE EXTERNAL TABLE IF NOT EXISTS db.table (column string) STORED AS AVRO LOCATION '/foo/bar' After that I…
Rene A
  • 19
  • 4
1
vote
0 answers

How to pass variable values of a hive script, to a shell script within it

I have a hive script which takes parameters in the form of --hivevar var_name="value" from beeline and the substitution works well within hive queries. Within this hive script, I wanted to run a shell script with a variable passed as a parameter. I…