carto-import-export-data
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecarto-import-export-data
carto-import-export-data
Move data into the warehouse from local files / URLs (), pull data out ( for usage data; warehouse-native unloads for everything else), and prepare tilesets for performant map rendering of large geospatial datasets.
carto importcarto activity export将数据从本地文件/URL导入仓库(使用),导出数据(使用导出使用数据;其他数据使用仓库原生导出功能),并为大型地理空间数据集的高性能地图渲染准备瓦片集。
carto importcarto activity exportWhen to use this skill
何时使用此技能
- The user has a CSV / GeoJSON / Shapefile / GeoParquet file and wants it queryable in the warehouse.
- The user wants to refresh an existing table from a remote URL.
- The user wants to render a 10M+-row spatial dataset on a map (needs tileset preparation).
- The user is bulk-exporting CARTO activity data to disk for offline analysis.
If the user just wants to query a file already in the warehouse, jump to . If they want to discover what's already there, .
carto-query-datawarehousecarto-explore-datawarehouse- 用户拥有CSV/GeoJSON/Shapefile/GeoParquet文件,并希望在仓库中可查询该文件。
- 用户希望从远程URL刷新现有表。
- 用户希望在地图上渲染1000万行以上的空间数据集(需要准备瓦片集)。
- 用户正在批量导出CARTO活动数据到磁盘以进行离线分析。
如果用户只是想查询仓库中已有的文件,请跳转至。如果他们想了解仓库中已有的内容,请查看。
carto-query-datawarehousecarto-explore-datawarehouseQuick reference
快速参考
bash
undefinedbash
undefinedImport a local file
导入本地文件
carto import --file ./data.csv
--connection carto_dw
--destination project.dataset.table
--connection carto_dw
--destination project.dataset.table
carto import --file ./data.csv
--connection carto_dw
--destination project.dataset.table
--connection carto_dw
--destination project.dataset.table
Import from a URL
从URL导入
carto import --url https://example.com/data.geojson
--connection carto_dw
--destination my_project.demo.regions
--connection carto_dw
--destination my_project.demo.regions
carto import --url https://example.com/data.geojson
--connection carto_dw
--destination my_project.demo.regions
--connection carto_dw
--destination my_project.demo.regions
Async (return immediately, poll separately)
异步模式(立即返回,单独轮询)
carto import --file ./big.parquet
--connection carto_dw
--destination my_project.demo.huge
--async
--connection carto_dw
--destination my_project.demo.huge
--async
carto import --file ./big.parquet
--connection carto_dw
--destination my_project.demo.huge
--async
--connection carto_dw
--destination my_project.demo.huge
--async
Overwrite existing table
覆盖现有表
carto import --file ./data.csv
--connection carto_dw
--destination my_project.demo.t
--overwrite
--connection carto_dw
--destination my_project.demo.t
--overwrite
undefinedcarto import --file ./data.csv
--connection carto_dw
--destination my_project.demo.t
--overwrite
--connection carto_dw
--destination my_project.demo.t
--overwrite
undefinedWhat's in this skill
此技能包含的内容
| Topic | Reference |
|---|---|
| references/imports.md |
| Tileset preparation for large maps | references/tilesets.md |
Exporting data: warehouse-native unloads vs | references/exports.md |
| 主题 | 参考文档 |
|---|---|
| references/imports.md |
| 大型地图的瓦片集准备 | references/tilesets.md |
数据导出:仓库原生导出 vs | references/exports.md |
Always-on guidance
通用指南
- is the connection name (from
--connection), not the warehouse project ID. If you only know the project, runconnections listfirst to find the matching connection.carto connections list --json - is the fully-qualified target name in the warehouse's syntax:
--destination(BigQuery),project.dataset.table(Snowflake),DATABASE.SCHEMA.TABLE(Postgres/Redshift),schema.table(Databricks),catalog.schema.table(Oracle).SCHEMA.TABLE - 1GB hard limit per file. For larger files, split or pre-stage to cloud storage and use to a presigned URL.
--url - skips column type detection — use it when you've prepared a precise schema and don't want CARTO to second-guess types (especially for columns that look numeric but should stay string, like ZIP codes).
--no-autoguessing - Imports are async at the API level. The CLI defaults to polling-to-completion; pass to return immediately. The CLI prints a job ID in async mode that you can use to check progress.
--async - For tilesets, the workflow is import → SQL job to materialize a tileset table → reference the tileset in a map. The tileset itself is created in the warehouse, not by the CLI.
- 是连接名称(来自
--connection),而非仓库项目ID。如果仅知道项目名称,请先运行connections list查找匹配的连接。carto connections list --json - 是仓库语法中的完整目标名称:
--destination(BigQuery)、project.dataset.table(Snowflake)、DATABASE.SCHEMA.TABLE(Postgres/Redshift)、schema.table(Databricks)、catalog.schema.table(Oracle)。SCHEMA.TABLE - 单个文件大小上限为1GB。对于更大的文件,请拆分或预先存储到云存储,并使用指向预签名URL的参数。
--url - 会跳过列类型检测 — 当你已准备好精确的 schema,且不希望CARTO自动推断类型时使用(尤其是对于看似数值但应保持字符串类型的列,如邮政编码)。
--no-autoguessing - API层面的导入是异步的。CLI默认会轮询直到完成;传递参数可立即返回。异步模式下CLI会打印作业ID,你可以用它检查进度。
--async - 对于瓦片集,工作流程是导入 → 通过SQL作业物化瓦片集表 → 在地图中引用瓦片集。瓦片集本身是在仓库中创建的,而非通过CLI创建。