pyodbc – Connecting to HDInsight

Cheat Code

import pyodbc 

pyodbc.autocommit = True
cnxn = pyodbc.connect('DRIVER={Hortonworks Hive ODBC Driver};Host=MyHiveServer.azurehdinsight.net;Port=443;AuthMech=6;SSL=1;UID=superUser;PWD=[SuperPower];HTTPPath=/hive2;', autocommit=True)

So…. recently I’m exploring Python as it’s COOL!
What other reason you need to learn new things except that when it’s COOL!

Anyhow, I want to try to compare data between my HDInsight Hive External Table vs CSV using Python.
Because I can, so why not 🙂

First challenge in this journey is how the heck can I connect to Hive from Python.
Run the cheat code above and you can connect to HDInsight in no time!

Smooth and Sweet!

Photo by Soonios Pro from Pexels

Published by Feivel

We love to travel!

Leave a comment

Design a site like this with WordPress.com
Get started