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,040 points
295 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 65,820 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
• 12,110 points
112 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
777 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
• 65,820 points
32 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
• 65,820 points
437 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
• 65,820 points
61 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
17 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
• 9,030 points
1,636 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
• 9,030 points
130 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
• 65,820 points
132 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
• 65,820 points
227 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.