Tutorials

Load data from Snowflake to Hubspot

Parker Rogers
Parker Rogers November 10, 2021

Parker is a data community advocate at Census with a background in data analytics. He's interested in finding the best and most efficient ways to make use of data, and help other data folks in the community grow their careers. Salt Lake City, Utah, United States

In this article, you'll learn three different methods to load data from Snowflake to Hubspot:

  • Snowflake CSV download
  • Reverse ETL
  • SnowSQL command line

So you’ve got some valuable Snowflake data that you’d like to load into Hubspot? What a great idea! Once accomplished, you’ll be able to:

  • Create custom audiences for retargeting campaigns
  • Use product data to send personalized emails
  • Create lead and account scoring models using product data
  • The list goes on!

At Census, we believe that syncing your data warehouse (Snowflake) and your operational tools (Hubspot) is the best and most efficient way to understand and serve your customers. In this article you will find three different methods to accomplish your goal. Step-by-step instruction and pros and cons are included in each method so you can pick the one that works best for you and your team.

Method #1: Snowflake CSV download

You can export a Snowflake query as a CSV and import it into Hubspot on . Yes, I said CSV. It’s not the most scalable method, but it works if you do it right. Here are the steps:

Snowflake steps:

  • Write a SQL query for the data you want to send to Hubspot. Next, click run. I wrote a simple query in Snowflake’s worksheets.


with score as (
select user_id,
    sum(case
        when name = 'webinar attended' then 3
        when name = 'appointment created' then 4
        when name = 'appointment shared' then 2
        when name = 'content downloaded' then 2
        when name = 'email opened' then 1
        else 0
    end) as lead_score
    from demo.events
group by user_id)

select email, first_name, last_name, lead_score, u.user_id
from demo.users u
join score on score.user_id = u.user_id
where lead_score > 100
limit 10

  • Once your query is executed, click the download icon ( ⬇️  ). Next, click CSV (comma-seperated values), then click export.

That’s all you need to do on Snowflake. Now, head over to Hubspot for next steps.

Hubspot steps:

  • Go to your Hubspot account and click contacts. From the dropdown, select your destination. If you are importing contacts, click contacts. If you are importing companies, click companies. Next, click import on the top right corner of your screen and then click start an import.
  • Click file from your computer as your import and click next at the bottom right of your screen. Select one file (unless you have multiple) and click next again. Select one object (unless you have multiple) and click next. Click contacts as your object import and click next.

Select choose a file and find the CSV file that you exported from Snowflake. Click next. You will then map the columns from your import to the correct Hubspot properties. If you have unmatched columns, match them correctly or click don’t import data in unmatched columns.

  • Check create a list of contacts from this import and click finish import.

If you followed all the Snowflake and Hubspot steps correctly, then you’ve successfully loaded data  from Snowflake to Hubspot.

Is this the right method for you and your team? Here’s a quick breakdown of the pros and cons:

Method #1 is easy to learn, but it might not be a long term solution. Let’s take a look at Reverse ETL.

Method #2: Reverse ETL

Census is a reverse ETL tool that allows you to move data seamlessly between a warehouse (Snowflake) and a destination app (Hubspot). Unlike the previous method, Census doesn’t require CSV imports and exports. Additionally, Census is scalable. You can automate and schedule the movement of data from Snowflake to Hubspot. Learn how by watching this video tutorial, or you can follow the steps below:

Initial setup steps:

  • Connect Snowflake as a data source using your account credentials.
  • Connect Hubspot as a service connection using your account credentials.
  • Write a SQL model to create an instance of your Snowflake database. You can use the same SQL query used in Method #1.

Steps to sync data to from Snowflake to Hubspot:

  1. Map your required fields (email address) and optional remaining fields. Remaining fields aren’t required to sync, but can further enrich your data in Hubspot.
  2. Schedule your sync frequency. Your data can be synched as often as every 15 minutes, or as infrequently as once a month.

Reverse ETL is both easy to use and scalable. It has an intuitive user interface, and it is powerful enough to send large amounts of data and handle various configurations: scheduling, modeling, data sync types, etc. If you plan to sync Snowflake and Hubspot on a regular basis, Census might be the best option for you.

​​Here’s a breakdown of the pros and cons of Method #2:

You’ve seen how Reverse ETL can sync data between Snowflake and Hubspot, let’s check out one last method that’s comparable to method #1, Snowflake CSV download.

Method #3: SnowSQL Command Line

SnowSQL is a good method for people who are comfortable using their command line and Python. Using SnowSQL, you can query data from your Snowflake warehouse and export it as a CSV. Similar to Method #1, you can only download around 50mb of data (roughly 250k rows) from Snowflake. If you need to download more than that, I recommend using the COPY command. Here are the SnowSQL steps to loading data from Snowflake to Hubspot:

Once you’ve installed SnowSQL correctly, you will do the following in your command line:

  • Log into SnowSQL using your snowflake credentials:


$ snowsql -a <account_identifier> -u <user_name>

If you don’t know your credentials, you can run the following query in your Snowflake worksheet to get your account identifier and username:


SELECT CURRENT_ACCOUNT(), CURRENT_USER()

  • Next you will specify the connection, database, schema name, and query that you’d like to pull from Snowflake. Don’t press enter yet. You’re query will look something like this so far:


snowsql -c, my_database_connection, -d my_database_name -s public -q "SELECT * FROM content.public.people”

  • Next you will configure the query above so that it exports a CSV file. The whole query will look something like this:


snowsql -c, my_database_connection, -d my_database_name -s public -q "SELECT * FROM content.public.people", -o output_format=csv -o header=false -o timing=false -o friendly=false  > output_file.csv

Now that you have successfully downloaded a CSV, you can follow the Hubspot steps from method #1.

Here are the pros and cons of method #3:

The pros and cons of the SnowSQL method are similar to method #1. Both require manual CSV imports and exports. The main difference is that SnowSQL gives you more flexibility with your CSV download.

Where to go from here: Choosing the best option to export data from Snowflake to Hubspot

You’ve seen three methods for loading data from Snowflake to Hubspot, and you've examined the pros and cons of each one.

If you are doing a one-off task, I recommend using method #1 or #3. They are simple and effective, but they aren't a long-term solution. If you plan to load data from Snowflake to Hubspot on a regular basis, I recommend method #2, Reverse ETL.

Census's Reverse ETL tool will automatically sync Snowflake to Hubspot. No CSVs or command line required. Your Hubspot will consistently have the freshest, most up-to-date data that you and your team can trust. Additionally, Hubspot is just one the countless destinations that you can sync to Snowflake. Try it for free today!

Related articles

Customer Stories
Built With Census Embedded: Labelbox Becomes Data Warehouse-Native
Built With Census Embedded: Labelbox Becomes Data Warehouse-Native

Every business’s best source of truth is in their cloud data warehouse. If you’re a SaaS provider, your customer’s best data is in their cloud data warehouse, too.

Best Practices
Keeping Data Private with the Composable CDP
Keeping Data Private with the Composable CDP

One of the benefits of composing your Customer Data Platform on your data warehouse is enforcing and maintaining strong controls over how, where, and to whom your data is exposed.

Product News
Sync data 100x faster on Snowflake with Census Live Syncs
Sync data 100x faster on Snowflake with Census Live Syncs

For years, working with high-quality data in real time was an elusive goal for data teams. Two hurdles blocked real-time data activation on Snowflake from becoming a reality: Lack of low-latency data flows and transformation pipelines The compute cost of running queries at high frequency in order to provide real-time insights Today, we’re solving both of those challenges by partnering with Snowflake to support our real-time Live Syncs, which can be 100 times faster and 100 times cheaper to operate than traditional Reverse ETL. You can create a Live Sync using any Snowflake table (including Dynamic Tables) as a source, and sync data to over 200 business tools within seconds. We’re proud to offer the fastest Reverse ETL platform on the planet, and the only one capable of real-time activation with Snowflake. 👉 Luke Ambrosetti discusses Live Sync architecture in-depth on Snowflake’s Medium blog here. Real-Time Composable CDP with Snowflake Developed alongside Snowflake’s product team, we’re excited to enable the fastest-ever data activation on Snowflake. Today marks a massive paradigm shift in how quickly companies can leverage their first-party data to stay ahead of their competition. In the past, businesses had to implement their real-time use cases outside their Data Cloud by building a separate fast path, through hosted custom infrastructure and event buses, or piles of if-this-then-that no-code hacks — all with painful limitations such as lack of scalability, data silos, and low adaptability. Census Live Syncs were born to tear down the latency barrier that previously prevented companies from centralizing these integrations with all of their others. Census Live Syncs and Snowflake now combine to offer real-time CDP capabilities without having to abandon the Data Cloud. This Composable CDP approach transforms the Data Cloud infrastructure that companies already have into an engine that drives business growth and revenue, delivering huge cost savings and data-driven decisions without complex engineering. Together we’re enabling marketing and business teams to interact with customers at the moment of intent, deliver the most personalized recommendations, and update AI models with the freshest insights. Doing the Math: 100x Faster and 100x Cheaper There are two primary ways to use Census Live Syncs — through Snowflake Dynamic Tables, or directly through Snowflake Streams. Near real time: Dynamic Tables have a target lag of minimum 1 minute (as of March 2024). Real time: Live Syncs can operate off a Snowflake Stream directly to achieve true real-time activation in single-digit seconds. Using a real-world example, one of our customers was looking for real-time activation to personalize in-app content immediately. They replaced their previous hourly process with Census Live Syncs, achieving an end-to-end latency of <1 minute. They observed that Live Syncs are 144 times cheaper and 150 times faster than their previous Reverse ETL process. It’s rare to offer customers multiple orders of magnitude of improvement as part of a product release, but we did the math. Continuous Syncs (traditional Reverse ETL) Census Live Syncs Improvement Cost 24 hours = 24 Snowflake credits. 24 * $2 * 30 = $1440/month ⅙ of a credit per day. ⅙ * $2 * 30 = $10/month 144x Speed Transformation hourly job + 15 minutes for ETL = 75 minutes on average 30 seconds on average 150x Cost The previous method of lowest latency Reverse ETL, called Continuous Syncs, required a Snowflake compute platform to be live 24/7 in order to continuously detect changes. This was expensive and also wasteful for datasets that don’t change often. Assuming that one Snowflake credit is on average $2, traditional Reverse ETL costs 24 credits * $2 * 30 days = $1440 per month. Using Snowflake’s Streams to detect changes offers a huge saving in credits to detect changes, just 1/6th of a single credit in equivalent cost, lowering the cost to $10 per month. Speed Real-time activation also requires ETL and transformation workflows to be low latency. In this example, our customer needed real-time activation of an event that occurs 10 times per day. First, we reduced their ETL processing time to 1 second with our HTTP Request source. On the activation side, Live Syncs activate data with subsecond latency. 1 second HTTP Live Sync + 1 minute Dynamic Table refresh + 1 second Census Snowflake Live Sync = 1 minute end-to-end latency. This process can be even faster when using Live Syncs with a Snowflake Stream. For this customer, using Census Live Syncs on Snowflake was 144x cheaper and 150x faster than their previous Reverse ETL process How Live Syncs work It’s easy to set up a real-time workflow with Snowflake as a source in three steps: