Skip to main content
Version: 0.4 (Latest)

MotherDuck Reference

Reference material for MotherDuck Publishing -- data type mappings, CLI arguments, querying, and troubleshooting.

Data Type Mapping

Source types map automatically to DuckDB/MotherDuck-compatible types. LakeXpress exports through Parquet, so the mapping is driven by the normalized source type name.

PostgreSQL to DuckDB/MotherDuck

PostgreSQL TypeDuckDB/MotherDuck Type
SMALLINTSMALLINT
INTEGER, INT4INTEGER
BIGINT, INT8BIGINT
NUMERIC(p,s)DECIMAL(p,s)
REAL, FLOAT4REAL
DOUBLE PRECISION, FLOAT8DOUBLE
VARCHAR(n), TEXT, CHAR(n), array []VARCHAR
BOOLEANBOOLEAN
DATEDATE
TIMETIME
TIMESTAMPTIMESTAMP
TIMESTAMPTZTIMESTAMPTZ
BYTEABLOB
UUIDUUID
JSON, JSONBJSON

SQL Server to DuckDB/MotherDuck

SQL Server TypeDuckDB/MotherDuck Type
TINYINTTINYINT
SMALLINTSMALLINT
INTINTEGER
BIGINTBIGINT
DECIMAL(p,s)DECIMAL(p,s)
MONEYDECIMAL(19,4)
SMALLMONEYDECIMAL(10,4)
FLOAT, REALREAL
BITBOOLEAN
VARCHAR(n), NVARCHAR(n), CHAR(n), NCHAR(n), TEXT, NTEXTVARCHAR
DATEDATE
DATETIME, DATETIME2, SMALLDATETIMETIMESTAMP
DATETIMEOFFSETTIMESTAMPTZ
VARBINARYBLOB
UNIQUEIDENTIFIERUUID

Oracle to DuckDB/MotherDuck

Oracle TypeDuckDB/MotherDuck Type
NUMBERDECIMAL(38,9)
NUMBER(p,s)DECIMAL(p,s)
FLOATREAL
VARCHAR2(n), NVARCHAR2(n), CHAR(n), CLOB, NCLOBVARCHAR
DATEDATE
TIMESTAMPTIMESTAMP
RAW, BLOBBLOB

Teradata to DuckDB/MotherDuck

Teradata TypeDuckDB/MotherDuck Type
BYTEINT, VARCHAR(n), CHAR(n), CLOB, VARBYTEVARCHAR
SMALLINTSMALLINT
INTEGERINTEGER
BIGINTBIGINT
DECIMAL(p,s), NUMERIC(p,s)DECIMAL(p,s)
NUMBERDECIMAL(38,9)
FLOAT, REALREAL
DATEDATE
TIMETIME
TIMESTAMPTIMESTAMP
BYTE, BLOBBLOB

MySQL to DuckDB/MotherDuck

MySQL TypeDuckDB/MotherDuck Type
TINYINTTINYINT
SMALLINTSMALLINT
MEDIUMINT, YEAR, VARCHAR(n), CHAR(n), TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT, ENUM, SET, TINYBLOB, MEDIUMBLOB, LONGBLOBVARCHAR
INTINTEGER
BIGINTBIGINT
DECIMAL(p,s)DECIMAL(p,s)
FLOATREAL
DOUBLEDOUBLE
BITBOOLEAN
DATEDATE
TIMETIME
DATETIME, TIMESTAMPTIMESTAMP
BINARY, VARBINARY, BLOBBLOB
JSONJSON

MariaDB to DuckDB/MotherDuck

MariaDB TypeDuckDB/MotherDuck Type
TINYINTTINYINT
SMALLINTSMALLINT
MEDIUMINT, YEAR, VARCHAR(n), CHAR(n), TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT, ENUM, SET, TINYBLOB, MEDIUMBLOB, LONGBLOBVARCHAR
INTINTEGER
BIGINTBIGINT
DECIMAL(p,s)DECIMAL(p,s)
FLOATREAL
DOUBLEDOUBLE
BITBOOLEAN
DATEDATE
TIMETIME
DATETIME, TIMESTAMPTIMESTAMP
BINARY, VARBINARY, BLOBBLOB
JSONJSON

SAP HANA to DuckDB/MotherDuck

SAP HANA TypeDuckDB/MotherDuck Type
TINYINTTINYINT
SMALLINTSMALLINT
INTEGERINTEGER
BIGINTBIGINT
DECIMAL(p,s)DECIMAL(p,s)
SMALLDECIMALDECIMAL(38,9)
REALREAL
DOUBLEDOUBLE
BOOLEANBOOLEAN
VARCHAR(n), NVARCHAR(n), CHAR(n), NCHAR(n), CLOB, NCLOB, TEXTVARCHAR
DATEDATE
TIMETIME
TIMESTAMP, SECONDDATETIMESTAMP
VARBINARY, BLOBBLOB

CLI Reference

MotherDuck Publishing Arguments

OptionTypeDescription
--publish_target IDStringCredential ID for MotherDuck publishing (required)
--publish_schema_pattern PATTERNStringDynamic schema naming pattern (default: {schema})
--publish_table_pattern PATTERNStringDynamic table naming pattern (default: {table})
--publish_method TYPEStringTable type: external (default) or internal
--n_jobs NIntegerNumber of parallel workers for table creation (default: 1)

Querying MotherDuck Tables

Once published, query tables via any of these methods.

MotherDuck Web UI:

Log in to app.motherduck.com and run:

SELECT * FROM my_analytics.lx_tpch_1.customer LIMIT 10;

DuckDB CLI:

duckdb "md:my_analytics?motherduck_token=your_token"
SELECT * FROM lx_tpch_1.customer LIMIT 10;

Python (duckdb):

import duckdb

conn = duckdb.connect("md:my_analytics?motherduck_token=your_token")
df = conn.execute("SELECT * FROM lx_tpch_1.customer LIMIT 10").df()
print(df)

Python with environment variable:

import os
import duckdb

os.environ["motherduck_token"] = "your_token"
conn = duckdb.connect("md:my_analytics")
df = conn.execute("SELECT * FROM lx_tpch_1.customer LIMIT 10").df()
print(df)

Troubleshooting

Common Issues

"Authentication failed":

  • Verify your token is valid and not expired
  • Check token permissions for the target database
  • For env mode, ensure motherduck_token is set

"Database not found":

  • Verify the database name matches an existing MotherDuck database
  • Create the database in MotherDuck UI before publishing

"IO Error: No files found that match the pattern" or "Permission error: Missing or invalid credentials":

  • This means MotherDuck cannot access your private S3/GCS/Azure bucket
  • Create a secret in MotherDuck with your cloud storage credentials (see Storage Access)
  • Verify secrets are configured: SELECT * FROM duckdb_secrets();
  • Test access: SELECT count(*) FROM read_parquet('s3://your-bucket/path/*.parquet');

"Cannot read file" (external views):

  • Verify cloud storage credentials in MotherDuck
  • Check that the S3/GCS/Azure path contains valid Parquet files
  • Ensure the bucket allows access from MotherDuck
  • Verify the files exist: aws s3 ls s3://your-bucket/path/ --recursive | head

"Connection timeout":

  • Check network connectivity
  • MotherDuck requires outbound HTTPS
  • Verify no firewall is blocking the connection

Verifying Setup

Test MotherDuck connectivity:

duckdb "md:my_analytics?motherduck_token=your_token" -c "SELECT 1"

Test cloud storage access from MotherDuck:

SELECT * FROM read_parquet('s3://your-bucket/path/to/file.parquet') LIMIT 1;

Configuring Storage Secrets

See Storage Access from MotherDuck in Prerequisites for detailed instructions on configuring S3, GCS, or Azure secrets.

Comparison with Other Targets

FeatureMotherDuckBigQuerySnowflakeDuckLake
Query EngineDuckDBBigQuerySnowflakeDuckDB
External TablesViews with read_parquet()External tablesExternal tablesDuckLake catalog
Native TablesCREATE TABLE AS SELECTLoad jobsCOPY INTONot supported
ServerlessYesYesNo (warehouse required)N/A (local)
SQL DialectDuckDB/PostgreSQLBigQuery SQLSnowflake SQLDuckDB/PostgreSQL
Best ForAnalytics, explorationLarge-scale analyticsEnterprise data warehouseLocal development

See Also

Copyright © 2026 Architecture & Performance.