Package: meltanolabs-target-snowflake
target-snowflakeTarget for Snowflake.Built with theMeltano Singer SDK.Capabilitiesaboutstream-mapsschema-flatteningtarget-schemaSettingsSettingRequiredDefaultDescriptionuserTrueNoneThe login name for your Snowflake user.passwordFalseNoneThe password for your Snowflake user.private_key_pathFalseNonePath to private key file. SeeKey pair authprivate_key_passphraseFalseNonePassphrase to decrypt private key if encrypted.accountTrueNoneYour account identifier. SeeAccount Identifiers.databaseTrueNoneThe initial database for the Snowflake session.schemaFalseNoneThe initial schema for the Snowflake session.warehouseFalseNoneThe initial warehouse for the session.roleFalseNoneThe initial role for the session.add_record_metadataFalse1Whether to add metadata columns.clean_up_batch_filesFalse1Whether to remove batch files after processing.default_target_schemaFalseNoneThe default target database schema name to use for all streams.stream_mapsFalseNoneConfig object for stream maps capability. For more information check outStream Maps.stream_map_configFalseNoneUser-defined config values to be used within map expressions.flattening_enabledFalseNone'True' to enable schema flattening and automatically expand nested properties.flattening_max_depthFalseNoneThe max depth to flatten schemas.A full list of supported settings and capabilities is available by running:target-snowflake --aboutInitializing a Snowflake AccountThis target has an interactive feature that will help you get a Snowflake account initialized with everything needed to get started loading data.UserRoleWarehouseDatabaseProper grantsThe CLI will ask you to provide information about the new user/role/etc. you want to create but it will also need SYSADMIN credentials to execute the queries.
You should prepare the following inputs:AccountUser that has SYSADMIN and SECURITYADMIN access. These comes default with the user that created the Snowflake account.The password for your SYSADMIN user.Run the following command to get started with the interactive CLI.
Note - the CLI will print the SQL queries it is planning to run and confirm with you before it makes any changes.poetryruntarget-snowflake--initialize# Alternatively using Meltano CLImeltanoinvoketarget-snowflake--initializeThe CLI also has a "dry run" mode that will print the queries without executing them.Check out the demo of thison YouTube.Configure using environment variablesThis Singer target will automatically import any environment variables within the working directory's.envif the--config=ENVis provided, such that config values will be considered if a matching
environment variable is set either in the terminal context or in the.envfile.UsageYou can easily runtarget-snowflakeby itself or in a pipeline usingMeltano.Executing the Target Directlytarget-snowflake--version
target-snowflake--help# Test using the "Carbon Intensity" sample:tap-carbon-intensity|target-snowflake--config/path/to/target-snowflake-config.jsonDeveloper ResourcesInitialize your Development Environmentpipxinstallpoetry
poetryinstallCreate and Run TestsCreate tests within thetarget_snowflake/testssubfolder and
then run:poetryrunpytestYou can also test thetarget-snowflakeCLI interface directly usingpoetry run:poetryruntarget-snowflake--helpTesting withMeltanoNote:This target will work in any Singer environment and does not require Meltano.
Examples here are for convenience and to streamline end-to-end orchestration scenarios.Your project comes with a custommeltano.ymlproject file already created.Next, install Meltano (if you haven't already) and any needed plugins:# Install meltanopipxinstallmeltano# Initialize meltano within this directorycdtarget-snowflake
meltanoinstallNow you can test and orchestrate using Meltano:# Test invocation:meltanoinvoketarget-snowflake--version# OR run a test `elt` pipeline with the Carbon Intensity sample tap:meltanoruntap-carbon-intensitytarget-snowflakeSDK Dev GuideSee thedev guidefor more instructions on how to use the Meltano SDK to
develop your own Singer taps and targets.