Import tasks¶
Select the import method according to the data source and file type, and then query the task status, file results or running records.
Select task¶
Task |
interface |
Description |
|---|---|---|
Query import task list |
Lists the import tasks in the current workspace that have read permission. |
|
Query import task details |
Read the definition and current status of an import task. |
|
Understand the content returned by the import task |
Describes the record fields and applicable conditions returned by importing task lists and details. |
|
Import files from connector |
Files or directories are imported from the connector, unstructured files are written to the data volume, and structured file data is written to the target table. |
|
Upload and import files from local |
Import files from local, write unstructured files to the data volume, and write structured file data to the target table. |
|
Import structured data from database |
Select a table, collection, or other supported object from the database connector and write data from it to the target table. |
|
Determine structured import backfill location |
Backfill starting point for parsing database structured import tasks. |
|
Modify a paused import task |
Update a paused import task. |
|
Remove import task records |
Delete task records and do not roll back data written to the target. |
|
Request to pause an import in progress |
Request to suspend the import task being executed. A successful response indicates that it has been accepted. |
|
Resume a paused import |
Request to resume the paused import task. A successful response indicates that it has been accepted. |
|
Query the import task file list |
Lists the file-level processing results of an import task, filtered by file status. |
|
Query the import task running record list |
List the running records of an import task to confirm the status and processing scope of each execution. |
|
Query import task statistics |
Returns the total number of tasks that the current caller can view and the number of running, waiting, and failed tasks. |
|
Process failed import files again |
Request to retry the specified failed file or all failed files. A successful response indicates that it has been accepted. |
local structured file¶
First upload the connector file and obtain the temporary file ID. Then click Local upload and create import task to fill in the request. Fill in the temporary file ID table_config.conn_file_ids and fill in the target table configuration.
First confirm where the data will be imported¶
Unstructured Import: The selected data volume is the final writing location. The connector mode specifies the data volume by volume_id. In local mode, the data volume is specified by the multipart field VolumeID. The current request does not have a “Destination Directory” field and the file is written to the selected data volume.
Structured file import: Data is written to the target table specified by table_config. Fill in table_id when selecting an existing table. When creating a new table, fill in database_id, new_table: true and create_table. This type of task does not use a data volume as the target location for data rows.
Database structured import: Data is written to the target table specified by structured_load_config.target. The request cannot carry volume_id and has no target directory field.
The source path to the connector file or directory is specified by source_config.common_file_task_config.uris. The meta path in local upload is only used to describe and filter the upload source path, not the target directory within the data volume.
View connector file types¶
Before creating a task, you can first call Query connector file list. data.files[].type in the response represents the file type recognized by the connector, and data.files[].uri can be used as the source URI for the connector file import.
The Structured file selector for create pages currently only allows selection of CSV (7), XLS (24), and XLSX (25).
The Unstructured file filter for creating pages offers document, audio, video, image, web, email, CAD and other categories. Fill in file_filter_config.file_types with the type value returned from the file list or file_types from the local upload.
File types only represent types recognized by the file name. Whether the task can be completed still depends on the source file, connector, and import configuration. After submitting the task, please check the task details, task files or running records to confirm the actual results.
Local upload quantity and size limits¶
The following table is the local file selection limit for the currently created page, not the server-side processing limit of the interface.
Import type |
The quantity that can be selected at a time |
Single file size |
Description |
|---|---|---|---|
unstructured document |
Up to 20 files |
Max 200 MiB |
You can select a local file or folder. When you select a folder, each file within it counts towards 20 files. |
structured document |
1 files |
Max 200 MiB |
The current file selector only allows CSV, XLS or XLSX. |
Unstructured import configurable items¶
After selecting the data volume for unstructured import, you can set the following conditions as needed:
Page function |
Request fields |
function. |
|---|---|---|
Connector Source/Local Upload |
/task JSON request or /connectors/upload multipart request |
Decide whether to read from the connector or upload a local file directly. |
One-time/periodic import |
load_mode_config |
Connector sources can be executed once, or the directory can be scanned on a minute, hourly, or daily basis. Periodic tasks can only select directories. |
File type filter |
file_filter_config.file_types or file_types |
Optional documents, audio, video, pictures, web pages, emails, CAD and other types. Do not filter by type when selecting “Other”. |
path regularity |
file_filter_config.path_regex or path_regex |
Only files whose source path matches the regular expression are processed. |
decompression strategy |
unzip_keep_structure |
The current page handles compressed packages in a flat manner. |
Deduplication strategy |
dedup.by、dedup.strategy |
Duplicate files can be determined by file name and/or MD5 and can be skipped or overwritten. |