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β
Name | Reference | Type | Required | Default | Options | Description |
---|---|---|---|---|---|---|
Access Token | MOTHERDUCK_TOKEN | Password | β | - | - | The API token for programmatic access to MotherDuck |
Database | MOTHERDUCK_DATABASE | Alphanumeric | β | - | - | 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 Name | MOTHERDUCK_TABLE | Alphanumeric | β | - | - | The name of the target table in MotherDuck to upload to |
Source File Name | MOTHERDUCK_FILE_NAME | Alphanumeric | β | - | - | The name of the file to upload to MotherDuck |
Source Folder Name | MOTHERDUCK_FOLDER | Alphanumeric | β | - | - | The optional folder location of where the source file is located |
Insert Method | MOTHERDUCK_INSERT_METHOD | Select | β | append | Append: append Create or Replace: replace | The insert method to use upon upload |
Source File Match Type | MOTHERDUCK_MATCH_TYPE | Select | β | - | 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'