0% found this document useful (0 votes)
142 views21 pages

Data View Technical Documentation

The athenahealth Data View documentation outlines the features and functionalities of the Data View platform, which provides clients with secure access to their analytics data via Snowflake. It covers account types, user access, connection methods, and data unloading procedures, as well as details on custom views and user roles. The document serves as a comprehensive guide for clients to effectively utilize their data within the athenahealth ecosystem.

Uploaded by

vivekmails91
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
142 views21 pages

Data View Technical Documentation

The athenahealth Data View documentation outlines the features and functionalities of the Data View platform, which provides clients with secure access to their analytics data via Snowflake. It covers account types, user access, connection methods, and data unloading procedures, as well as details on custom views and user roles. The document serves as a comprehensive guide for clients to effectively utilize their data within the athenahealth ecosystem.

Uploaded by

vivekmails91
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

athenahealth

Data View
Documentation
Version 23.3
Updated on 03/22/2023
Confidential and Proprietary
Contents
1 Introduction ....................................................................................................................................3
1.1 Account Info ......................................................................................................................................... 3

2 Account Types ................................................................................................................................4


2.1 Client-Managed Account ................................................................................................................ 4

2.2 athena-Managed Account .............................................................................................................. 4

3 Data View User Access ................................................................................................................5


4 Connecting to Data View...........................................................................................................6
4.1 Databases and Warehouses............................................................................................................ 6

4.2 Connection Types ............................................................................................................................... 6

4.3 Metadata Tables .................................................................................................................................. 7

4.4 User Query History ............................................................................................................................. 8

4.5 Sample Queries .................................................................................................................................... 8

5 Unloading data from Snowflake ............................................................................................9


6 Custom View ................................................................................................................................ 12
6.1 Enable Custom View roles ........................................................................................................... 12

6.2 Enable Custom View in READER account ............................................................................ 13

7 Data View User Roles ............................................................................................................... 15


7.1 Public Role .......................................................................................................................................... 15

7.2 Custom View Roles ......................................................................................................................... 15

7.3 DATAINTEGRATIONADMIN Role ............................................................................................ 15

7.4 Steps to provide roles and access ............................................................................................. 15

8 Support ........................................................................................................................................... 18
8.1 Reporting Issues ............................................................................................................................... 18

8.2 Common Issues ................................................................................................................................. 18

9 Sample Codes ............................................................................................................................... 19


9.1 Java Sample ........................................................................................................................................ 19

9.2 Python Sample .................................................................................................................................. 21

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


1 Introduction
athenahealth Data View provides clients with a secure and efficient direct database connection to
athena's analytics platform which contains athenaNet client data optimized for analytics. Data View is
intended to give clients easier access to their data and more freedom in how and where that data is
leveraged.

Enterprise data warehouse (EDW) users can use Data View to retrieve their data directly from athena
without the need to import CSV or other flat-file types; similarly, Business intelligence (BI) users can
leverage their data directly in their BI tool of choice.

Connectivity to the data is available in several ways and is described in the Connecting to Data
View section below. Specific data models (databases, schemas, and tables) and sample queries are
also provided to help you get started leveraging Data View within your organization.

1.1 Account Info


You should have already received your account information. If you have not, please contact the Data
View Support team prior to trying to connect to Data View.

This information is required when connecting to Data View using one of the methods described below
in the Connecting to Data View section.

IMPORTANT: If you would like Data View to also enforce IP whitelisting on your account, you must
notify the Data View Support Team that you would like to add an IP to your account. Once IP
whitelisting is enabled any Snowflake queries/requests will only be allowed from that IP.

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


2 Account Types

2.1 Client-Managed Account


Data View provides an option to share data directly with a client-managed Snowflake account.
Following conditions and details are required to enable this feature:
• Client must have the Business Critical Edition , formerly known as Enterprise for Sensitive Data
(ESD), that allows them to store PHI
• Client’s instance of snowflake must be in AWS West region
• Client must provide their Snowflake account URL. For example,
https://abc.snowflakecomputing.com/

2.2 athena-Managed Account


For the athena- managed Data View, athena will provide a Snowflake Reader Account for the Client.
This account will provide read-only access to the client’s data.

Please refer to the following Snowflake Documentation for details.

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


3 Data View User Access
Data View Users can now use the Data View Settings page in athenaNet to manage users and create
service account users. Data View Settings (User Management) page is not available for Data View
Partners and Client-Managed accounts.

Based on your athenaNet permissions, you will be able to perform various tasks such as reset
password, unlock user, enable / disable service user, and create service user.

You must have the Access to Data View athenaNet permission to view the page and access some
features like:
• View the account URL
• View Data View User Management section (only logged in user details appear)
• User Operations such as Reset password, unlock a user, and disable MFA are available to this role

You must have the Data View User Management athenaNet permission to view the page and access
all features.

• View the account URL


• View Data View User Management section (all user’s details appear)
• User Operations such as Reset password, unlock a user, enable / disable service user and disable
MFA are available to this role
• Create Service Account
Manage IP Whitelisting

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


4 Connecting to Data View
To provide secure and scalable access to your analytics data, Data View leverages Snowflake
technology. When you use Data View you will be connecting to a Snowflake data warehouse
provisioned explicitly for your data.

4.1 Databases and Warehouses


In Snowflake, databases and warehouses are separate concepts. Data in Snowflake is in tables, which
are organized into schemas, which are contained in a database. To query the data, warehouses are
used. Warehouses are independent massively parallel processing (MPP) compute clusters composed
of multiple compute nodes that form the processing layer. For more information on overall Snowflake
architecture and concepts, see Snowflake’s Key Concepts & Architecture

4.2 Connection Types


While Snowflake supports several ways to connect, Data View currently supports ODBC, JDBC, Python,
AWS Private Link and data integration with cloud services such as S3, GCS, etc. While the other
connection techniques may work, they have not been validated for use by Data View. To get a more
detailed overview of connecting, visit Snowflake’s Connecting to Snowflake documentation.

4.2.1 ODBC
Installing, configuring, and connecting via ODBC is described in depth here. If you are using
Linux or Mac OS, specific ways to validate your connection are also provided in the
documentation.

4.2.2 JDBC
Installing, configuring, and connecting via JDBC is described in depth here. Once you have
followed the JDBC documentation, see the Java sample located in the Sample Code section
below.

4.2.3 Python
Installing, configuring, and connecting via Python is described in depth here. Once you have
followed the Python documentation, see the Python sample located in the Sample Code section
below.

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


4.2.4 Data Integration with Cloud Services
Connecting and configuring athena-Managed Data View reader account to cloud services is
described in depth here. Data Integration with cloud services allows users to unload data from
Snowflake reader account to Amazon S3, Google Cloud Storage and Microsoft Azure.

Step-1: To activate or enable Data Integration services for an account, please create a
support ticket by following the process as mentioned in support section.

Step-2: Once the Data Integration service is enabled for an account,


DATAINTEGRATIONADMIN user role will be available in user roles section of User
management. An authorized Data view user can provision this user role on the Data
View Settings page in athenaNet. Please check the User Roles and Access section for
details.

4.2.5 AWS Private Link


The athena-managed solution offers AWS private link support, and it requires you to share
your AWS account IDs with athenahealth to enable and configure the private link support. To
activate or enable AWS Private Link services for an account, please create a support ticket by
following the process as mentioned in support section.

4.2.6 Validating your connection


When validating your connection, if you are unable to see specific databases, tables, or
schemas, ensure that you are specifying the correct account, user, password, warehouse,
database, schema, and role properties in your connection. How these values are specified are
dependent on the type of connection (i.e. ODBC, JDBC, Python all have slightly different ways
of specifying these values). Refer to the documentation for the specific connection type for
more information. You can also try using SnowSQL to validate your connection properties and
even try out some of your Data View queries.

4.3 Metadata Tables


TABLEUPDATES provides details on the volume of data that has been added or updated per table
each day (ROWSUPDATED), as well as a LASTUPDATEDTIME(UTC) column to identify when data is
refreshed daily. Querying for table and column descriptions:

• show views; | To show descriptions of the tables in Data View - ensure you’re looking in the
ATHENAHEALTH database and ATHENAONE schema and run the following:

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


• select * from table(describe_view('CLAIM')); | To shows descriptions of the columns in a
specific table, as well as primary and foreign keys (using CLAIM as an example) - ensure
you’re looking in the ATHENAHEALTH database and ATHENAONE schema and run the
following

4.4 User Query History


Data View users will be able to view their executed queries via below tables. This is applicable
for athena-Managed accounts.

• USER_QUERY_HISTORY table
All Data View users will be able to view their executed query details in READERACCOUNT
(new Database) - READERACCONT_INFORMATION (Schema) - USER_QUERY_HISTORY
(Table)

• ADMIN_QUERY_HISTORY table
The table provides access to view all queries executed at the account level in
READERACCOUNT (new Database) - READERACCONT_INFORMATION (Schema) -
ADMIN_QUERY_HISTORY (Table). Applicable for users with DATAINTEGRATIONADMIN or
CUSTOMDB_RW roles. For more details about roles, please check Section 7

4.5 Sample Queries


● Average number of claims per day over the last 30 days:
select round(count(CLAIM.CLAIMID)/30) from
CLAIM
where
CLAIM.CLAIMCREATEDDATETIME >= DateAdd(day, -30, current_date());

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


4.6 Unloading data from Snowflake
For more details to connect and configure athena-Managed Data View reader account to cloud
services, please refer Snowflake Documentation.

Following accesses are required to unload data into AWS S3, GCS and Azure.

• Enable CUSTOM integration at account level. Please contact [email protected]


to enable the same for your account
• DATAINTEGRATIONADMIN role for the user. For more details about DATAINTEGRATIONADMIN role,
please check Section 7.3

4.6.1 Unloading into Amazon S3

Snowflake Documentation Amazon S3.

Template
CREATE STORAGE INTEGRATION <Name>
TYPE = EXTERNAL_STAGE
STORAGE_PROVIDER = S3
ENABLED = TRUE
STORAGE_AWS_ROLE_ARN = '<Provide ARN details>'
STORAGE_ALLOWED_LOCATIONS = ('<Provide S3 location details>');

COPY INTO <Provide S3 location details> from


"ATHENAHEALTH"."ATHENAONE"."TABLE_NAME" storage_integration = <Name>;

Example
CREATE STORAGE INTEGRATION TESTDB
TYPE = EXTERNAL_STAGE
STORAGE_PROVIDER = S3
ENABLED = TRUE
STORAGE_AWS_ROLE_ARN = 'arn:aws:iam::123456789:role/dataview_service'
STORAGE_ALLOWED_LOCATIONS = ('s3://prod-dataview/sf_data/');

COPY INTO s3://prod-dataview/sf_data/ from "ATHENAHEALTH"."ATHENAONE"."CLAIM "


storage_integration = TESTDB;

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


4.6.2 Unloading into Google Cloud Storage

Snowflake documentation for Google Cloud Storage.


Template
CREATE STORAGE INTEGRATION <integration_name>
TYPE = EXTERNAL_STAGE
STORAGE_PROVIDER = GCS
ENABLED = TRUE
STORAGE_ALLOWED_LOCATIONS = ('gcs://<bucket>/<path>/', 'gcs://<bucket>/<path>/')
[ STORAGE_BLOCKED_LOCATIONS = ('gcs://<bucket>/<path>/', 'gcs://<bucket>/<path>/') ]

Example
create storage integration gcs_int
type = external_stage
storage_provider = gcs
enabled = true
storage_allowed_locations = ('gcs://mybucket1/path1/', 'gcs://mybucket2/path2/')
storage_blocked_locations = ('gcs://mybucket1/path1/sensitivedata/',
'gcs://mybucket2/path2/sensitivedata/');

COPY INTO <Provide GCS location details> from


"ATHENAHEALTH"."ATHENAONE"."TABLE_NAME" storage_integration = <Name>;

4.6.3 Unloading into Microsoft Azure

Snowflake Documentation for Azure Container


Template
CREATE STORAGE INTEGRATION <integration_name>
TYPE = EXTERNAL_STAGE
STORAGE_PROVIDER = AZURE
ENABLED = TRUE
AZURE_TENANT_ID = '<tenant_id>'
STORAGE_ALLOWED_LOCATIONS =
('azure://<account>.blob.core.windows.net/<container>/<path>/',
'azure://<account>.blob.core.windows.net/<container>/<path>/')
[ STORAGE_BLOCKED_LOCATIONS =
('azure://<account>.blob.core.windows.net/<container>/<path>/',
'azure://<account>.blob.core.windows.net/<container>/<path>/') ]

Example

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


create storage integration azure_int
type = external_stage
storage_provider = azure
enabled = true
azure_tenant_id = 'a123b4c5-1234-123a-a12b-1a23b45678c9'
storage_allowed_locations =
('azure://myaccount.blob.core.windows.net/mycontainer1/mypath1/',
'azure://myaccount.blob.core.windows.net/mycontainer2/mypath2/')
storage_blocked_locations =
('azure://myaccount.blob.core.windows.net/mycontainer1/mypath1/sensitivedata/',
'azure://myaccount.blob.core.windows.net/mycontainer2/mypath2/sensitivedata/');

COPY INTO <Provide Azure location details> from


"ATHENAHEALTH"."ATHENAONE"."TABLE_NAME" storage_integration = <Name>;

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


5 Custom View
If you have selected either the athena-Managed Plus or Advanced solution, the Custom View feature
enables Data View users to create and delete new schemas, tables, and views within your Data View
account. All new tables or views can be created in Custom View by leveraging the existing tables
available within your Data View account. This feature will not support any data import or data
ingestion or updates to existing records. See Snowflake Documentation for more details.

Please contact Support to enable this feature.

New user roles such as CUSTOMDB_R and CUSTOMDB_RW are required to access this feature. Unless
otherwise scoped and agreed by athenahealth, any Authorized User of a Tablespace included in your
Data View account that has administrative authority to designate roles and permissions within such
Tablespace shall have the ability to grant access to itself and other Authorized Users to your Data View
account. The Custom View feature is only available upon request for clients that have purchased the
Plus or Advanced package.

Once the feature is enabled, users can see ‘CUSTOMDB’ as an additional database in their reader
accounts.

5.1 Enable Custom View roles


1. Once the Custom View feature is enabled for a reader account, admin users will have an
option to enable / disable CUSTOMDB_R, CUSTOMDB_RW access

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


2. A Superuser or administrator can enable and disable CUSTOMDB_R, CUSTOMDB_RW role
access via Data View User Management page using ‘Update’ option for individual users. Please
check the User Roles and Access section for details.

5.2 Enable Custom View in READER account


Once the CUSTOMDB_RW role is enabled, users will be able to see the additional role in their reader
account. User can use “Switch Role” option to select CUSTOMDB_RW role.

Users can also update their Role, Warehouse, Database, Schema selection using following option.

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


5.2.1 Sample DDL and DML
• CREATE schema CUSTOMDB.CUSTOMSCHEMA;
• CREATE table CUSTOMDB.CUSTOMSCHEMA.ACEAPPOINTMENT as select * from
ATHENAHEALTH.ATHENAONE.ACEAPPOINTMENT;
• ALTER Table CUSTOMDB.CUSTOMSCHEMA.ACEAPPOINTMENT RENAME to ACE;
• CREATE or REPLACE table CUSTOMDB.CUSTOMSCHEMA.ACE (CONTEXTID number not null);
• ALTER table CUSTOMDB.CUSTOMSCHEMA.ACE alter DEPARTMENTID comment '50 character
column';
• ALTER table CUSTOMDB.CUSTOMSCHEMA.ACE alter DEPARTMENTID set data type NUMBER(12,0);
• ALTER table CUSTOMDB.CUSTOMSCHEMA.ACE rename column DEPARTMENTID to
DEPARTMENTNUMBER;
• ALTER table CUSTOMDB.CUSTOMSCHEMA.ACE add column TESTCOLUMN varchar(50);
• ALTER table CUSTOMDB.CUSTOMSCHEMA.ACE drop column TESTCOLUMN;
• ALTER table CUSTOMDB.CUSTOMSCHEMA.ACE drop column
FOREIGNREFERRALDOCUMENTNUMBER;
• DROP table CUSTOMDB.CUSTOMSCHEMA.ACEAPPOINTMENT;
• DROP schema CUSTOMDB.CUSTOMSCHEMA;

5.2.2 READER Account Limitations


A reader account is intended primarily for querying data shared by the provider of the account. Adding
new data to the account and/or updating shared data in the account is not supported. As such, the
following DML and DDL commands are not allowed:
• INSERT
• UPDATE
• DELETE
• MERGE
• COPY INTO <table>
• CREATE PIPE
• CREATE SHARE

Other operations are allowed. Please refer to Snowflake Documentation for more details.

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


6 Data View User Roles
Any Authorized User of a Tablespace included in your Data View account that has administrative
authority to designate roles and permissions within such Tablespace shall have the ability to grant
access to self and other authorized Users to your Data View account.

6.1 Public Role


• PUBLIC role does not have global privileges on the reader account. It means that, PUBLIC role
does not have privilege to create a new Schema, Table, Views.
• All Data View Users will have PUBLIC role (by default)

6.2 Custom View Roles


When Custom View feature is enabled at an account level, CUSTOMDB_R, CUSTOMDB_RW role will be
available for Superuser or administrator to provide access CUSTOMDB roles are disabled by default
for all users.

• CUSTOMDB_R: CUSTOMDB_R role provides read only access to both ATHENAHEALTH and
CUSTOMDB database, schema, and tables. Users can read data from CUSTOMDB and
ATHENAHEALTH databases.
• CUSTOMDB_RW: CUSTOMDB_RW role provides read & write access to CUSTOMDB and read
only access to ATHENAHEALTH databases. Users with CUSTOMDB_RW role can create new
schemas, tables, and views in CUSTOMDB by accessing/reading the data from
ATHENAHEALTH.

6.3 DATAINTEGRATIONADMIN Role


When Data Integration feature is enabled at an account level, DATAINTEGRATIONADMIN role will be
available for authorized Data View user to provide access. DATAINTEGRATIONADMIN role is disabled
by default for all users.
• DATAINTEGRATIONADMIN: DATAINTEGRATIONADMIN role will provide access to create data
integration with AWS S3, GCS and Microsoft Azure
Note: ATHENHEALTH DB and respective schemas, tables, views will remain READONLY for all roles and
access

6.4 Steps to provide roles and access


1. Login into athenahealth: https://athenanet.athenahealth.com/
2. Click on Settings Icon and select Practice Manager under ADMIN

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


3. In the Task Bar, under PRACTICE LINKS — Data View, click Data View Settings.

4. Data View User Management page will be displayed

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com
7 Support
Support is available for Data View. For questions, issues, or problems related to Data View usage,
please create a support case by navigating to: athenaNet > Support > Create Case or Call > click
Additional Services > click Data View > click Create Online Case

If you do not have access to athenaNet, you may contact support be sending an email to
[email protected]. Please describe the question/problem/etc. in the body of
your email.

7.1 Reporting Issues


When reporting issues arise, please include as much information as possible so that the problem can
be efficiently investigated. This information may include, but is not limited to, providing specific
queries, tables, and schema names. Anything relevant to the reported issue should be provided at the
time of reporting the issue.

7.2 Common Issues


This section lists some of the common issues that new users of Data View may encounter.
● Unable to access Snowflake. Error code: 390420, Message: IP nnn.nnn.nnn.nnn is not allowed
to access Snowflake. Contact your local security administrator.
o This message indicates that the IP you are trying to connect from is not properly
whitelisted. Ensure that the IP you are connecting from is the same IP that was
whitelisted for your account
● Unable to see specific databases, tables, or schemas.
o Ensure that you are specifying the correct account, user, password, warehouse,
database, schema, and role properties in your connection. How these values are
specified are dependent on the type of connection (i.e. ODBC, JDBC, Python all have
slightly different ways of specifying these values)
● Failed to execute statement due to the following error: Warehouse 'XXXX' is suspended. Use
'alter warehouse XXXX resume;' command if you need to use it again.
o Issue the following statement 'alter warehouse XXXX resume' in order to start the
suspended warehouse.

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


8 Sample Codes

8.1 Java Sample


Below is an example of a Java class to query your data using JDBC. Replace the static values near the
top of the class below with your account information. When running, ensure that the JDBC driver (jar)
is on your classpath.

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;

public class Data ViewJDBCExample {

// Replace these values with your account information


private static final String YOUR_USERNAME = "YOUR USERNAME";
private static final String YOUR_PASSWORD = "YOUR PASSWORD";
private static final String YOUR_ACCOUNT = "YOUR ACCOUNT";
private static final String YOUR_ROLE = "YOUR ROLE";
private static final String YOUR_WAREHOUSE = "YOUR WAREHOUSE";
private static final String YOUR_DATABASE = "YOUR DATABASE";
private static final String YOUR_SCHEMA = "YOUR SCHEMA";
private static final String YOUR_TABLE = "YOUR TABLE";
private static final String YOUR_COLUMN = "YOUR COLUMN";

public static void main(String[] args) throws Exception {


Connection connection = null;
Statement statement = null;
ResultSet resultSet = null;

try {
// get connection
System.out.println("Create JDBC connection");
connection = getConnection();
System.out.println("Done creating JDBC connection:");

// create statement
System.out.println("Create JDBC statement");
statement = connection.createStatement();
System.out.println("Done creating JDBC statement");

// query the data


System.out.println("Query demo");
resultSet = statement.executeQuery("select " + YOUR_COLUMN + " from " + YOUR_TABLE + " LIMIT
10");

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


System.out.println("Metadata:");
System.out.println("================================");

// fetch metadata
ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
System.out.println("Number of columns=" +
resultSetMetaData.getColumnCount());
for (int colIdx = 0; colIdx < resultSetMetaData.getColumnCount();
colIdx++) {
System.out.println("Column " + colIdx + ": type=" +
resultSetMetaData.getColumnTypeName(colIdx + 1) +
": name=" +
resultSetMetaData.getColumnName(colIdx + 1));
}

// fetch data
System.out.println("\nData:");
System.out.println("================================");
int rowIdx = 0;
while (resultSet.next()) {
System.out.println("row " + rowIdx + ", column 0: " +
resultSet.getString(1));
rowIdx++;
}
} finally {
if (resultSet != null) {
resultSet.close();
}

if (statement != null) {
statement.close();
}

if (connection != null) {
connection.close();
}
}
}

private static Connection getConnection()


throws SQLException {
try {
Class.forName("net.snowflake.client.jdbc.SnowflakeDriver");
} catch (ClassNotFoundException ex) {
System.err.println("Driver not found");
}

// build connection properties


Properties properties = new Properties();
properties.put("user",YOUR_USERNAME);
properties.put("password", YOUR_PASSWORD);

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com


properties.put("account", YOUR_ACCOUNT);
properties.put("warehouse", YOUR_WAREHOUSE);
properties.put("database", YOUR_DATABASE);
properties.put("schema", YOUR_SCHEMA);
properties.put("role", YOUR_ROLE);

String connectStr = "jdbc:snowflake://" + YOUR_ACCOUNT + ".snowflakecomputing.com";


return DriverManager.getConnection(connectStr, properties);
}
}

8.2 Python Sample


Below is an example of a Python script to query your data. Replace the values indicated below using
<> with your account information.

#!/usr/bin/env python
import snowflake.connector

# Create the connection


ctx = snowflake.connector.connect(
user='<YOUR USERNAME>',
password='<YOUR PASSWORD>',
account='<YOUR ACCOUNT NAME>',
host='<YOUR ACCOUNT NAME>.snowflakecomputing.com',
database='<YOUR DATABASE>',
schema='<YOUR SCHEMA>',
warehouse='<YOUR WAREHOUSE>',
role='<YOUR ROLE>',
)

# Query a table
cs = ctx.cursor()
try:
cs.execute("select <SOME COLUMN> from <SOME TABLE> LIMIT 10")
all = cs.fetchall()
print(all)
finally:
cs.close()

311 Arsenal Street Watertown, MA 02472 • 617.402.1000 • athenahealth.com

You might also like