Model Data Loading
Reminders:
- Please read Access and Authentication REST API and understand how authentication works.
- On Curl command line, don't forget to quote the URL if it contains the special char
&.
Load Segment
-
POST http://host:port/kylin/api/models/{model_name}/segments -
URL Parameters
model_name-requiredstring, model name.
-
HTTP Body: JSON Object
project-requiredstring, project name.start-optionalstring, when the model is built in full, it is not required, and it is required when the model is incrementally built. start time of segment (partition column exist), type: timestamp, unit: ms. For example,694195200000means1992-01-01 00:00:00.end-optionalstring, when the model is built in full, it is not required, and it is required when the model is incrementally built. end time of segment (partition column exist), type: timestamp, unit: ms. For example,883584000000means1998-01-01 00:00:00.build_all_indexes-optionalboolean, build all indexes in the new segment, default value istruesub_partition_values-optionalArray, sub-partition value, used for multi-level partition model. the default is empty. For multi-leve partition model, whenbuild_all_indexesistrue(all indexes need to be built), this value is required. Whenbuild_all_indexesisfalse(when creating an empty segment), the value must be empty.priority-optionalint, set job priority with range0-4which indicates the priority from high to low. Default value is3build_all_sub_partitions-optionalboolean, build all sub partition values for multi-level partition model,default value isfalseyarn_queue-optionalstring, specify the YARN queue used by the job, it can be set after these two parameters were set: kylin.engine-yarn.queue.in.task.enabled (whether to allow set specified YARN queue for build task, default value is false), kylin.engine-yarn.queue.in.task.available (available YARN queues, separate them with English commas)tag-optionalobject, job tag, if the field is set, when calling the Get Job List API, the field will be the same back when returning the job. It can be used for system integration, mark the job and deal with it accordingly. By default, the maximum size of value is 1024 KB , which can be set by the configure kylin.job.tag-max-size=1024.
-
HTTP Header
Accept: application/vnd.apache.kylin-v4-public+jsonAccept-Language: enContent-Type: application/json;charset=utf-8
-
Curl Request Example
curl -X POST \
'http://host:port/kylin/api/models/SSB_LINEORDER/segments' \
-H 'Accept: application/vnd.apache.kylin-v4-public+json' \
-H 'Accept-Language: en' \
-H 'Authorization: Basic QURNSU46S1lMSU4=' \
-H 'Content-Type: application/json;charset=utf-8' \
-d '{"project":"doc_expert", "start": "694195200000", "end": "883584000000","build_all_indexes":true,"sub_partition_values":[["1"],["2"]],"build_all_sub_partitions":false}' -
Response Example
{
"code": "000",
"data": {
"jobs": [
{
"job_name": "INC_BUILD",
"job_id": "61f4d697-e648-4ace-8e52-155829417b2a"
},
{
"job_name": "INDEX_BUILD",
"job_id": "0217b970-4525-468b-ba25-58bbb168d612"
}
]
},
"msg": ""
}