import

Import a geospatial file into your data warehouse from a local file or URL. Waits for completion by default.

Supported formats: CSV, GeoJSON, GeoPackage, GeoParquet, KML, KMZ, Shapefile (zip). Size limit: 1 GB per file. Supported warehouses: CARTO DW, BigQuery, Snowflake, PostgreSQL, Redshift.

carto import --file <path> --connection <name> --destination <table>
carto import --url <url> --connection <name> --destination <table>
carto import status <jobId>                     # Fetch status of an async import job

Options

Option
Description

--file <path>

Local file to upload (mutually exclusive with --url).

--url <url>

Remote file URL to import (mutually exclusive with --file).

--connection <name>

(Required) Connection name.

--destination <fqn>

(Required) Fully qualified table name.

--overwrite

Overwrite an existing table (default: false).

--no-autoguessing

Disable automatic column type detection (default: autoguessing enabled).

--async

Return immediately with the job ID instead of polling to completion.

Examples

# Import local CSV
carto import --file ./data.csv --connection carto_dw --destination project.dataset.my_table

# Import from URL with overwrite
carto import \
  --url https://example.com/data.geojson \
  --connection carto_dw \
  --destination project.dataset.table \
  --overwrite

# Kick off async, then poll status separately
carto import --file ./big.csv --connection carto_dw --destination my.table --async
carto import status <jobId>

# JSON output (for scripts)
carto import --file ./data.geojson --connection carto_dw --destination project.dataset.table --json

CSV auto-detection

For CSV files, CARTO automatically detects geometry columns or builds geometries from lat/lon columns:

  • Geometry columns: geom, Geom, geometry, the_geom, wkt, wkb.

  • Latitude columns: latitude, lat, Latitude.

  • Longitude columns: longitude, lon, Lon, Longitude, lng, Lng.

Disable with --no-autoguessing if you need full control over the schema.

Last updated

Was this helpful?