What is java sql SQLException org apache thrift transport TTransportException in Hive

0 votes

I'm trying to create a table in hive using java. The code has thrown an exception while execution.

java.sql.SQLException: org.apache.thrift.transport.TTransportException

My code is:

public void createTable(String tableName) {
        try{
            Statement stat = con.createStatement();

        String QueryString = "CREATE TABLE '"+tableName+"'(User_Id INTEGER NOT NULL AUTO_INCREMENT, " + "User_Name VARCHAR(25), UserId VARCHAR(20), User_Pwd VARCHAR(15), primary key(User_Id))";

        a = stat.executeUpdate(QueryString);
        if(a==1){
            System.out.println(a);
            System.out.println("Table has been created");
        }

        }catch(Exception e){
        System.out.println(e);}
} 

What is the reason behind this exception?

How can I fix it.?

Jul 30, 2019 in Big Data Hadoop by nitinrawat895
• 11,380 points
6,540 views

1 answer to this question.

0 votes

This particular exception is related to Hive logs. It says that there are some issues and you are expected to go through your Hive logs Stack where you will find out the exact core reason or error in the log file.

The most common issues are as follows: 

  1. Issues with meta store related to concurrency

  2. When you start hive server as $hive --service yourhiveserver and keep it running for days and then run your code, it is possible that your connection is the broker to the server and you will get exact same error. If you reconnect to the server and this error will go away. This is only because after some time wait_time expired and disconnect happens.

  3. Port specific errors

Be sure to set up an open Port for your Hive Server and set it as below before starting hive server:

 $export HIVE_PORT=10000
 $hive --service hiveserver
 $ _run_your_code

There might other possibilities as well. I suggest you look into the Hive Logs.

I hope this helps. Happy Learning...;-)

answered Jul 30, 2019 by ravikiran
• 4,620 points

Related Questions In Big Data Hadoop

0 votes
1 answer

What is thrift in Hive?

Hey, Thrift comes in the architectural part of ...READ MORE

answered May 13, 2019 in Big Data Hadoop by Gitika
• 65,910 points
6,133 views
0 votes
1 answer

Error: org.apache.thrift.transport.TTransportException (state=08S01,code=0)

This error usually occurs when the HiveServer2 ...READ MORE

answered Jun 4, 2019 in Big Data Hadoop by Ram
11,300 views
0 votes
1 answer
0 votes
1 answer

What is SerDe in Hadoop Hive?

The SerDe interface allows you to instruct ...READ MORE

answered Nov 21, 2018 in Big Data Hadoop by Akshay
5,419 views
0 votes
1 answer

What is Metastore in Hive?

It stores metadata for Hive tables (like their schema ...READ MORE

answered Dec 20, 2018 in Big Data Hadoop by Frankie
• 9,830 points
2,862 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
10,558 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
2,185 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
104,214 views
0 votes
1 answer

What is the use of Apache Kafka in a Big Data Cluster?

Kafka is a Distributed Messaging System which ...READ MORE

answered Jun 21, 2019 in Big Data Hadoop by ravikiran
• 4,620 points
710 views
0 votes
1 answer

What is Kafka? what is its importance in Big-Data?

Apache Kafka is a tool used in ...READ MORE

answered Apr 11, 2019 in Big Data Hadoop by ravikiran
• 4,620 points
1,523 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP