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:
Parameters | Description | Required |
---|---|---|
database_name | Database name | No, defaults to "default" database |
table_name | Table name | Yes |
files | Local file path | Yes |
csv_options | CSV related parameters | No |
array_separator (csv_options) | Array separator | No, defaults to "," |
separator (csv_options) | Separator to parse CSV file | No, defaults to ";" |
with_header | If 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 order | No, defaults to false |
batch_size | Batch size | No, defaults to 2000 |
op_type | Write operation type | No, defaults to insert, and insert, update, upsert are all optional |
wait_for_completion | Whether to wait until the job is done | No, defaults to true; if set to false, job ID will be returned |