Connect to Hive using Pyhive

0 votes

I have installed HDP 2.5 Sandbox on my windows system. I want to access Hive running on Sandbox using Python (to be specific "pyhive" library).

I am able to login to the HDP. The IP address is 127.0.0.1. I have installed pyhive library. However, I am unable to connect from system to Sandbox from python.

Can you suggest what to do?

Jan 8 in Big Data Hadoop by slayer
• 29,050 points
547 views

1 answer to this question.

0 votes

Here's how we can connect to Hive using pyhive

from pyhive import hive
import pandas as pd

#Create Hive connection 
conn = hive.Connection(host="127.0.0.1", port=10000, username="username")

# Read Hive table and Create pandas dataframe
df = pd.read_sql("SELECT * FROM db_Name.table_Name limit 10", conn)
print(df.head())
answered Jan 8 by Omkar
• 67,120 points

Related Questions In Big Data Hadoop

0 votes
1 answer

Cannot connect to Hive from MicroStrategy BI tool

The problem is with your hive authentication. ...READ MORE

answered May 8, 2018 in Big Data Hadoop by Shubham
• 13,110 points
145 views
0 votes
2 answers

How to connect Spark to a remote Hive server?

JDBC is not required here. Create a hive ...READ MORE

answered Mar 8 in Big Data Hadoop by Vijay Dixon
• 180 points
1,025 views
0 votes
1 answer

Error while connecting to Hive using Java JDBC

Use ​org.apache.hive.jdbc.HiveDriver as your driver. It ...READ MORE

answered Nov 21, 2018 in Big Data Hadoop by Omkar
• 67,120 points
56 views
0 votes
1 answer

Hive:Unable to insert values to an array column using "insert".

make a dummy table which has at least one row. INSERT ...READ MORE

answered Nov 30, 2018 in Big Data Hadoop by Omkar
• 67,120 points
641 views
0 votes
1 answer

Error connecting hive using python pyhs2

Seems like the host IP is not ...READ MORE

answered Jan 11 in Big Data Hadoop by Omkar
• 67,120 points
108 views
0 votes
0 answers

try except is not working while using hdfs command

Hi,  I am trying to run following things ...READ MORE

Mar 6 in Python by anonymous
28 views
0 votes
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
• 10,070 points
2,039 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
• 10,070 points
192 views
0 votes
1 answer

Hadoop: How to keep duplicates in Hive using collect_set()?

SELECT hash_id, COLLECT_LIST(num_of_cats) AS ...READ MORE

answered Nov 2, 2018 in Big Data Hadoop by Omkar
• 67,120 points
187 views
0 votes
1 answer

Hadoop Hive Hbase: How to insert data into Hbase using Hive (JSON file)?

You can use the get_json_object function to parse the ...READ MORE

answered Nov 15, 2018 in Big Data Hadoop by Omkar
• 67,120 points
406 views