Batch Load

Hippo standalone mode supports performing batch load from CSV files.

curl -u shiva:shiva -XPOST 'localhost:8902/hippo/v1/_standalone_load_data?pretty' -H 'Content-Type: application/json' -d'{
  "database_name": "default",
  "table_name" : "book",
  "files" : ["/tmp/test.csv"],
  "csv_options" : {
    "array_separator" : ",",
    "separator" : ";",
    "with_header" : false
  },
  "batch_size" : 2000,
  "op_type" : "insert",
  "wait_for_completion" : true
}';

Result:

{
  "job_type" : "load_data",
  "table" : "default#book",
  "files" : [
    "/tmp/test.csv"
  ],
  "success_number" : 100
}

Parameter description:

ParametersDescriptionRequired
database_nameDatabase nameNo, defaults to "default" database
table_nameTable nameYes
filesLocal file pathYes
csv_optionsCSV related parametersNo
array_separator (csv_options)Array separatorNo, defaults to ","
separator (csv_options)Separator to parse CSV fileNo, defaults to ";"
with_headerIf CSV file contains header, and the column order of CSV file can be specified via header; without header, CSV file will be parsed based on schema orderNo, defaults to false
batch_sizeBatch sizeNo, defaults to 2000
op_typeWrite operation typeNo, defaults to insert, and insert, update, upsert are all optional
wait_for_completionWhether to wait until the job is doneNo, defaults to true; if set to false, job ID will be returned
Table 23 Batch Load (Restful API)