You need to enable JavaScript to run this app.
导航
TOS文件数据导入任务
最近更新时间:2025.04.27 17:35:02首次发布时间:2025.04.27 17:35:02
我的收藏
有用
有用
无用
无用

概述

将 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