Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. import pyodbc
  2. import pandas as pd
  3.  
  4. # Setup the ODBC connection to the Dremio instance
  5. user_id = 'george'
  6. user_password = 'dem0passwd'
  7. cnxn = pyodbc.connect(r"DSN=Dremio Connector;UID={user};PWD={pwd}".format(user=user_id, pwd=user_password), autocommit=True)
  8.  
  9. # SQL style query to retrive the required data from Dremio
  10. sql = r'SELECT "Date", "Time" FROM "@george".some_game'
  11.  
  12. # Executing the query using the alredy open ODBC connection
  13. test_data = pd.read_sql(sql, cnxn)
  14.  
  15. # Disaplying the top 5 rows from the retrieved dataset
  16. test_data.head()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement