Versions Compared

Key

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

...

  • 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.
  • enclose:Enclosure character. When a CSV data field contains row separators or column separators, a single-byte character can be specified as an enclosure character to prevent accidental truncation. For example, if the column separator is ",", and the enclosure character is "'", then in the data "a,'b,c'", "b,c" will be interpreted as a single field.
  • escape:Escape character. Used to escape characters in a CSV field that are the same as the enclosure character. For example, if the data is "a,'b,'c'" and the enclosure character is "'", and it is desired that "b,'c" be interpreted as a single field, a single-byte escape character needs to be specified, such as "". Then the data should be modified to "a,'b,'c'".
  • merge_type:The merge type of data, supporting three types: APPEND, DELETE, UPSERT. Among these, APPEND is the default value, indicating that this batch of data needs to be appended to the existing data. DELETE means to delete all rows that have the same key as this batch of data. UPSERT semantics mean that all rows with the same data key are updated, and the rest are processed according to APPEND semantics.

  • format: Specifies the format of the data to be imported, supports csv and json, default is csv.

...

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


# -- load_sql
# insertINSERT intoINTO db.table 
# (
#     col, ...
# ) select
# SELECT 
#     col, ... 
# fromFROM httpread_loadfiles("property1"="value1");


# http parametersfile:///data.file") 
# with
# (
#     "column_separator" = ",",
#     "format" = "CSVcsv",
#     ...
# ));

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.

...