Skip to main content

MotherDuck - Upload File to Table

Overview​

Quickly upload a CSV or parquet file to a a database table in MotherDuck.

Recommended Setup This blueprint should be used after downloading or fetching data from another source.

File Types​

This blueprint can be used to upload either CSV or Parquet files. For larger datasets it is recommended to use Parquet files when possible.

Insert Type​

This blueprint can be used to overwrite data (with the Create or Replace option) or append to existing rows (with the Append option). In either case, if the table does not exist it will be created.

Match Type​

This blueprint supports uploading multiple files using a Glob pattern or a regular expression. For single file uploads, use the Exact Match option and provide the exact file name to upload.

Variables​

NameReferenceTypeRequiredDefaultOptionsDescription
Access TokenMOTHERDUCK_TOKENPasswordβœ…--The API token for programmatic access to MotherDuck
DatabaseMOTHERDUCK_DATABASEAlphanumericβž–--The optional database to connect to. If omitted, the blueprint will resort to the default. Additionally the database will be created if provided and it doesn't exist
Table NameMOTHERDUCK_TABLEAlphanumericβœ…--The name of the target table in MotherDuck to upload to
Source File NameMOTHERDUCK_FILE_NAMEAlphanumericβœ…--The name of the file to upload to MotherDuck
Source Folder NameMOTHERDUCK_FOLDERAlphanumericβž–--The optional folder location of where the source file is located
Insert MethodMOTHERDUCK_INSERT_METHODSelectβœ…appendAppend: append

Create or Replace: replace

The insert method to use upon upload
Source File Match TypeMOTHERDUCK_MATCH_TYPESelectβœ…-Exact Match: exact_match

Glob Match: glob_match

Regex Match: regex_match

The match type dictates whether a single file will be uploaded, or multiple that either match a glob or regex pattern

YAML​

Below is the YAML template for this Blueprint and can be used in the Fleet YAML Editor.

source:
blueprint: MotherDuck - Upload File to Table
inputs:
MOTHERDUCK_TOKEN: null ## REQUIRED
MOTHERDUCK_DATABASE: null
MOTHERDUCK_TABLE: null ## REQUIRED
MOTHERDUCK_FILE_NAME: null ## REQUIRED
MOTHERDUCK_FOLDER: null
MOTHERDUCK_INSERT_METHOD: append ## REQUIRED
MOTHERDUCK_MATCH_TYPE: null ## REQUIRED
type: BLUEPRINT
guardrails:
retry_count: 1
retry_wait: 0h0m0s
runtime_cutoff: 1h0m0s
exclude_exit_code_ranges:
- '101'
- '102'
- '103'
- '200'
- '210'
- '220'
- '249'