You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Techsupport <te...@sardonyx.in> on 2022/09/29 08:04:36 UTC

20220929-Single Record insert in HIVE is very slow

Hi,

We are using JAVA 1.8, Hadoop 3.3.4 and Hive 3.1.2 in Ubuntu 20.04. 

We are using the single node cluster only.

Database creation completed with in 0.23 Seconds

hive> create database testdb;

OK

Time taken: 0.23 seconds

Table Creation completed within 0.512 Seconds

hive> create table employee(id int,name String,City String);

OK

Time taken: 0.512 seconds

But insert takes more than 19 seconds for the single record insert. Why it
takes more time to insert a single record. Is my insert statement is wrong,
or we need to follow any other method to insert records in HIVE. While we
are import data from CSV file, it inserts more than 10,00,000 records with
in 1 second but single record takes 19 seconds. Kindly suggest me the
correct way to insert records in HIVE

hive> insert into employee values(1,'Alex','chennai');

Query ID = admin1_20220929124107_17fbde83-789d-4d73-a30f-7bb4f8de0311

Total jobs = 3

Launching Job 1 out of 3

Number of reduce tasks determined at compile time: 1

In order to change the average load for a reducer (in bytes):

  set hive.exec.reducers.bytes.per.reducer=<number>

In order to limit the maximum number of reducers:

  set hive.exec.reducers.max=<number>

In order to set a constant number of reducers:

  set mapreduce.job.reduces=<number>

Starting Job = job_1664428977939_0001, Tracking URL =
http://admin1:8088/proxy/application_1664428977939_0001/

Kill Command = /home/admin1/hadoop-3.3.4/bin/mapred job  -kill
job_1664428977939_0001

Hadoop job information for Stage-1: number of mappers: 1; number of
reducers: 1

2022-09-29 12:41:16,142 Stage-1 map = 0%,  reduce = 0%

2022-09-29 12:41:20,247 Stage-1 map = 100%,  reduce = 0%, Cumulative CPU 2.0
sec

2022-09-29 12:41:25,347 Stage-1 map = 100%,  reduce = 100%, Cumulative CPU
3.38 sec

MapReduce Total cumulative CPU time: 3 seconds 380 msec

Ended Job = job_1664428977939_0001

Stage-4 is selected by condition resolver.

Stage-3 is filtered out by condition resolver.

Stage-5 is filtered out by condition resolver.

Moving data to directory
hdfs://localhost:9000/home/admin1/apache-hive-3.1.2-bin/warehouse/employee/.
hive-staging_hive_2022-09-29_12-41-07_554_8461101845003861467-1/-ext-10000

Loading data to table default.employee

MapReduce Jobs Launched:

Stage-Stage-1: Map: 1  Reduce: 1   Cumulative CPU: 3.38 sec   HDFS Read:
16729 HDFS Write: 284 SUCCESS

Total MapReduce CPU Time Spent: 3 seconds 380 msec

OK                                                          

Time taken: 19.617 seconds

Thanks,

Karthick Ramu