Snowflake
The akenza Snowflake connector enables direct ingestion of device telemetry into the Snowflake Cloud Data Platform for large-scale analytics and cloud-native data warehousing.
The connector uses the Snowflake Snowpipe Streaming API to continuously ingest device data with low latency and high throughput (check its high-performance architecture).
This allows sensor data processed by akenza to be written directly into Snowflake tables without intermediate storage layers.
Setup
Follow the steps below to configure Snowflake for use with the akenza Snowflake connector.
Create the database and table
Create a database and a table that will store the incoming device data.
CREATE DATABASE <database_name>;
CREATE SCHEMA <schema_name>;
CREATE TABLE <database_name>.<schema_name>.<table_name> (
<col_name> <col_type>,
<col_name> <col_type>,
...
);Example
Example custom payload
The names in the payload must match the column names used in the Snowflake table, as these fields are mapped directly when the data is ingested through Snowpipe Streaming.
Create the Snowpipe Streaming pipe
Create a pipe that reads data from the Snowpipe Streaming data source.
Example
This pipe defines how incoming streamed data is mapped to the columns of the target table.
Each field referenced with $1:<field_name> corresponds to a field in the JSON payload sent to Snowflake via Snowpipe Streaming. The field names must match the fields used in the custom payload described in the previous section.
Create a role with required privileges for Snowpipe Streaming ingestion
To follow the principle of least privilege, it is recommended to create a dedicated role that only allows the connector to ingest data through the Snowpipe Streaming pipe. This role will be assigned to a service user used by the connector.
Create the role
Create a dedicated role that will be used for Snowpipe Streaming ingestion. This role will have only the privileges necessary to ingest data
Example
Grant required privileges
Grant the minimal privileges required for the role to access the database, schema, and streaming pipe.
Example
Create a Snowpipe Streaming user
Create a user that will be used by the connector to authenticate with Snowflake.
The akenza Snowflake connector authenticates using RSA key pair authentication.
Akenza public key:
Example
Grant the required role
Grant the necessary role to the user.
Example
Verify the configuration (optional step)
You can run the following commands to verify that the user, pipe, privileges, and data ingestion are configured correctly.
Finding Your Snowflake Account Identifier and URL
To configure a Snowflake output connector, you will need your account identifier and URL.
You can find both directly in the Snowflake web interface.
Log in to your Snowflake account.
Look at the account settings (bottom-left corner or as shown in the screenshot below). Navigate to
View account details. You will see: - Account identifier - a string likeZQPUGTG-YF50693- Account/Server URL - a hostname likeZQPUGTG-YF50693.snowflakecomputing.comUse these values when creating a new Snowflake output connector: - Account identifier:
<your-account-identifier>, likeZQPUGTG-YF50693- URL:<your-account-url>, likehttps://ZQPUGTG-YF50693.snowflakecomputing.com(prependhttps://to the hostname)

Troubleshooting
If ingestion does not work as expected, check the following link.
Last updated
Was this helpful?