Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
curl --location-trusted -u user:passwd [-H ""...] -T data.file -XPUT http://load_host:http_port/api/{db}/{table}/_load

Signature parameters

  • user/passwd: To verify user identity and import permissions.
  • label: Identifier of the import task.
  • column_separator: Used to specify the column separator in the import file, default is \t.
  • line_delimiter: Used to specify the newline character in the import file, default is \n.
  • where: Filter condition specified for the import task.
  • columns: Names of the column fields of the data to be imported.
  • format: Specifies the format of the data to be imported, supports csv and json, default is csv.

Using SQL to Express Load Parameters

It's possible to add a SQL parameter in the Header, which can replace the previous parameters such as column_separator, line_delimiter, where, columns, etc., for convenience of use.

Code Block
curl --location-trusted -u user:passwd [-H "sql: ${load_sql}"...] -T data.file -XPUT http://load_host:http_port/api/_http_load


# -- load_sql
# insert into db.table (col, ...) select stream_col, ... from http_load("property1"="value1");


# http parameters
# (
#     "column_separator" = ",",
#     "format" = "CSV",
#     ...
# )

Return Results

Since Load Action is a synchronous import method, the results of the import are directly returned to the user through the return value created for the import.

Example:

Code Block
{
  "Status": "Success",
  "NumberTotalRows": 1000000,
  "NumberFilteredRows": 1,
  "NumberUnselectedRows": 0,
  "LoadTimeMs": 2144
}

The following mainly explains the parameters of the Load Action import results:

  • Status: Import completion status.
  • NumberTotalRows: Total number of rows processed during import.
  • NumberFilteredRows: Number of rows that do not meet data quality standards.
  • NumberUnselectedRows: Number of rows filtered by the WHERE condition.
  • LoadTimeMs: Import completion time. Unit: milliseconds.

Proposed Changes



Code Block
public interface WriteStrategy extends Seriali
zable {

    void writer(BatchTableWrite batchTableWrite, String content, String columnSeparator)
            throws Exception;

    Schema retrieveSchema() throws Exception;

}

...