Skip to main content

macrometa-source-snowflake

A macrometa source that extracts data from a Snowflake database and produces JSON-formatted data following the Singer spec.

How to use it

TODO: Add proper context If you want to run this macrometa-source-snowflake connector independently please read further.

Install and Run

First, make sure Python 3 is installed on your system or follow these installation instructions for Mac or Ubuntu. It's recommended to use a virtualenv:

make venv

Configuration

  1. Create a config.json file with connection details to snowflake, here is a sample config file. Note: table is a mandatory parameter as well to avoid a long-running catalog discovery process. Please specify fully qualified table and view names and only that ones that you need to extract otherwise you can end up with very long running discovery mode of this source connector. Discovery mode is analysing table structures but Snowflake doesn't like selecting lot of rows from INFORMATION_SCHEMA or running SHOW commands that returns lot of rows. Please be as specific as possible.
  2. Run it in discovery mode to generate a properties.json
  3. Edit the properties.json and select the streams to replicate
  4. Run the source connector like any other singer compatible tap:
  macrometa-source-snowflake --config config.json --properties properties.json --state state.json

Authentication Methods

You can either use basic user/password authentication or Key Pair authentication.

User / Password authentication

Populate user and password in the config.json file

Key Pair authentication

To use key pair authentication, omit the password and instead provide the private_key to the unencrypted version of the private key and, optionally, the private_key_passphrase.

Discovery mode

The macrometa-source-snowflake connector can be invoked in discovery mode to find the available table and columns in the database:

$ macrometa-source-snowflake --config config.json --discover

A discovered catalog is output, with a JSON-schema description of each table. A source table directly corresponds to a Singer stream.

Replication methods

The two ways to replicate a given table are FULL_TABLE and LOG_BASED.

Full Table

Full-table replication extracts all data from the source table each time the connector is invoked.

LogBased

Macrometa source Snowflake connector can be used as a CDC (Change Data Capture) connector by specifying the Replication Method as LOG_BASED to capture any changes done at source and identify what records were inserted or updated or deleted, it will extract first all the records (i.e. FULL_TABLE) and then it will continuously listen to a Stream created on the Table to extract only the changes done.

To run tests:

  1. Define environment variables that requires running the tests
  export MACROMETA_SOURCE_SNOWFLAKE_ACCOUNT=<snowflake-account-name>
  export MACROMETA_SOURCE_SNOWFLAKE_DBNAME=<snowflake-database-name>
  export MACROMETA_SOURCE_SNOWFLAKE_USER=<snowflake-user>
  export MACROMETA_SOURCE_SNOWFLAKE_PASSWORD=<snowflake-password>
  export MACROMETA_SOURCE_SNOWFLAKE_PRIVATE_KEY=<snowflake-pk-path>
  export MACROMETA_SOURCE_SNOWFLAKE_PRIVATE_KEY_PASSPHRASE=<snowflake-passphrase>
  export MACROMETA_SOURCE_SNOWFLAKE_WAREHOUSE=<snowflake-warehouse>
  1. Install python dependencies
make venv
  1. To run unit tests: PS: There are no unit tests at the time of writing this document
make unit_test
  1. To run Integration tests
make integration_test

To run formatting and linting:

make venv format pylint

License

Apache License Version 2.0 See LICENSE to see the full text.

Metadata

Release files for macrometa-source-snowflake 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for macrometa-source-snowflake 1.0.0
File Size Uploaded
macrometa-source-snowflake-1.0.0.tar.gz 23.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for macrometa-source-snowflake 1.0.0
File Interpreter ABI Platform
macrometa_source_snowflake-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 48.7 kB

Release files / macrometa-source-snowflake-1.0.0.tar.gz

Download URL macrometa-source-snowflake-1.0.0.tar.gz
Size 23.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c6f4a407b3f57eb432f28b1c1258828f6a620cc8014f96c7dd466d9238372a29
BLAKE2b-256 checksum
How to use checksums
711b95f288a01958e554359acb60372de6f60ebe25ccebb817111d748cccfc31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / macrometa_source_snowflake-1.0.0-py3-none-any.whl

Download URL macrometa_source_snowflake-1.0.0-py3-none-any.whl
Size 25.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2557d7697a41b50239c4eee468de4caa8b496b5aa50c020da7c02e9c2b6ebce9
BLAKE2b-256 checksum
How to use checksums
183cfea11efcf3b930b37b660dfee81a3ebe324d29d80a23ed0c1adf7e2c4ccc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.0.54

2 release files

0.0.53

2 release files

0.0.52

2 release files

0.0.51

2 release files

0.0.50

2 release files

0.0.49

2 release files

0.0.48

2 release files

0.0.47

2 release files

0.0.46

2 release files

0.0.45

2 release files

0.0.44

2 release files

0.0.43

2 release files

0.0.42

2 release files

0.0.41

2 release files

0.0.40

2 release files

0.0.39

2 release files

0.0.38

2 release files

0.0.37

2 release files

0.0.36

2 release files

0.0.35

2 release files

0.0.34

2 release files

0.0.33

2 release files

0.0.32

2 release files

0.0.31

2 release files

0.0.30

2 release files

0.0.29

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page