0
votes

I'm new to Apache Hive. I have installed Hadoop in pseudo-distributed mode and installed Hive after that. Then I was trying to create a table and then insert some values into it using query. The table creation had no problem but while inserting values into the table, the process gets stuck.

This is the query is :

hive> create table Students
    > (StudentID INT,
    > firstname VARCHAR(50),
    > LastName VARCHAR(50),
    > Gender Char(1),
    > Email VARCHAR(100));
OK
Time taken: 0.364 seconds

But when inserting values:

hive> INSERT INTO Students
    > VALUES
    > (1,'Janani','Ravi','F','[email protected]'),
    > (2,'Swetha','Kollalapudi','F','Swetha@loonycorn'),
    > (3,'Navdeep','Singh','M','[email protected]'),
    > (4,'Vitthal','Srinivasan','M','[email protected]');
WARNING: Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.
Query ID = neron_20180515174044_74a1eaaa-5d42-4267-9261-ff66bd20e215
Total jobs = 3
Launching Job 1 out of 3
Number of reduce tasks is set to 0 since there's no reduce operator
Starting Job = job_1526382077653_0002, Tracking URL = http://neron-Latitude-3580:8088/proxy/application_1526382077653_0002/
Kill Command = /home/neron/ProgramFiles/Hadoop/hadoop-3.1.0/bin/hadoop job  -kill job_1526382077653_0002

I'm getting this result and this process stucks there.

This is the tracking result: Image

Am I done anything wrong or what is the problem with this?

2

2 Answers

0
votes

You can not directly insert data like that. You have to several other alternatives for achieving the same in hive. Please refer: this post

0
votes

First of all, I think you should correct the warning that you have when launching Hive. The reason for this warning is because you didn't configure your Hive correctly. In the directory of /hive/conf you need to edit the hive-site.xml to run with a hive.execution.engine not deprecated.

In my case, I used the engine Spark and add this lines to file hive-site.xml

hive-site.xml

<property> <name>hive.execution.engine</name> <value>spark</value> </property>

Hive 2.x use SPARK or TEZ engine to execute "complex" queries like insert. "Simple" queries like create tables don't use this engine to run so you don't have a error when run this query.

I don't know if this step will solve your problem, but you need correct this for queries in the future.