Hi Everyone!!
I have been working in SAP Analytics such as BI-BW, S/4 HANA and Native HANA for past 6 years. I have recently started exploring Python and ETL tools used in Big Data environments, trying to learn their integration with HANA. Please find below blog post on encounters with Python and Apache NIFI 1.6 (windows edition)
Pre-requisite –
Connecting with Python:
I am using pyhdb module to connect with HANA system via ODBC connection.
Create a new python file in any of your favourite code editors/IDE, I am using PyCharm.
Below code will be used to establish a connection to HANA, enter relevant host, port, user id and password
Once you have established the connection you can use below code to fetch data. One thing I noticed, when you execute a SQL query via below code it brings the table headers as part of data (first tuple) followed by the actual content of the table. As a quick and dirty solution, I have opened another cursor querying the system table which stores the metadata for all the tables to get the table headers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Subject | Kudos |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
User | Count |
---|---|
10 | |
9 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |