将 TOS 中的文件数据导入到 Collection 中,要求文件的列名必须和 Collection fields 重合,否则会解析失败
说明
使用前请先授权 VikingDB 跨服务访问 TOS 去授权
参数名 | 类型 | 必须 | 说明 | 子字段 | 类型 | 必选 | 说明 |
---|---|---|---|---|---|---|---|
task_type | string | 是 | 任务类型,填入TaskType.Data_Import | ||||
task_params | json | 是 | 任务参数 | collection_name | string | 是 | Collection 名称,必填 |
file_type | string | 是 | 文件类型, json 或者 parquet,必填 | ||||
tos_path | string | 是 | TOS 路径,格式 :{桶名}/{路径},注意不是域名。必填 | ||||
ignore_error | bool | 否 | 设置为 true 时遇到数据会继续解析文件,默认为 false |
curl -i -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: HMAC-SHA256 ***' \ https://api-vikingdb.volces.com/api/task/create \ -d '{ "task_type": "data_import", "task_params": { "collection_name": "example", #collection 名称 "file_type": "parquet", #文件格式 "tos_path": "bucket_name/tos_path" #tos路径,需要提前授权VikingDB访问TOS权限 } }'
属性 | 说明 |
---|---|
task_id | uuid |