官网API文档
- 官网中的api文档提供Cube、Job、Query、Metadata等接口说明:kylin-base-api
补充API文档
Project API
project base url:
http://{host}:{port}/kylin/api/projects
create project
curl -X POST -H "Authorization: Basic QURNSU46S1lMSU4=" -H "Content-Type: application/json" -d '{"name":"api\_create\_project","description":"api test"}' http://172.17.1.183:7070/kylin/api/projects
响应:
{
"uuid": "ba8ca4b3-552f-4a74-891a-e46b28404bdd",
"last\_modified": 1506326825236,
"version": "1.6.0",
"name": "api\_create\_project",
"tables": [],
"owner": "ADMIN",
"status": "ENABLED",
"create\_time\_utc": 1506326825236,
"last\_update\_time": null,
"description": "api test",
"realizations": [],
"models": [],
"ext\_filters": []
}
drop project
{projectName}
curl -X DELETE -H "Authorization: Basic QURNSU46S1lMSU4=" -H "Content-Type: application/json" http://172.17.1.183:7070/kylin/api/projects/api\_create\_project
Model API
model base url:
http://{host}:{port}/kylin/api/models
create model
- request:
POST http://{host}:{port}/kylin/api/models
- param:
{
"uuid": "",
"modelName": "user_active_model_create_test",
"modelDescData": "{\"uuid\":\"\",\"last_modified\":0,\"version\":\"1.6.0\",\"name\":\"user_active_model_create_test\",\"owner\":\"ADMIN\",\"description\":\"用户活跃统计模型\",\"fact_table\":\"TEST.ODS_SERVICE_ORDER_VIEW\",\"lookups\":[],\"dimensions\":[{\"table\":\"TEST.ODS_SERVICE_ORDER_VIEW\",\"columns\":[\"DM_CITY_NAME\",\"DM_CORPORATE_TYPE\",\"DM_IS_TEST_USER\",\"DM_ORDER_SOURCE\",\"DM_ORDER_STATUS\",\"DM_ORIGIN_AMOUNT_COMPARE\",\"DT\"]}],\"metrics\":[\"USER_ID\"],\"filter_condition\":\"\",\"partition_desc\":{\"partition_date_column\":\"TEST.ODS_SERVICE_ORDER_VIEW.DT\",\"partition_time_column\":null,\"partition_date_start\":0,\"partition_date_format\":\"yyyyMMdd\",\"partition_time_format\":\"HH:mm:ss\",\"partition_type\":\"APPEND\",\"partition_condition_builder\":\"org.apache.kylin.metadata.model.PartitionDesc$DefaultPartitionConditionBuilder\"},\"capacity\":\"MEDIUM\"}",
"successful": false,
"message": "",
"project": "user_register_project"
}
- example:
curl -X POST -H "Authorization: Basic QURNSU46S1lMSU4=" -H "Content-Type: application/json" -d '{"uuid":"","modelName":"user\_active\_model\_create\_test","modelDescData":"{\"uuid\":\"\",\"last\_modified\":0,\"version\":\"1.6.0\",\"name\":\"user\_active\_model\_create\_test\",\"owner\":\"ADMIN\",\"description\":\"用户活跃统计模型\",\"fact\_table\":\"TEST.ODS\_SERVICE\_ORDER\_VIEW\",\"lookups\":[],\"dimensions\":[{\"table\":\"TEST.ODS\_SERVICE\_ORDER\_VIEW\",\"columns\":[\"DM\_CITY\_NAME\",\"DM\_CORPORATE\_TYPE\",\"DM\_IS\_TEST\_USER\",\"DM\_ORDER\_SOURCE\",\"DM\_ORDER\_STATUS\",\"DM\_ORIGIN\_AMOUNT\_COMPARE\",\"DT\"]}],\"metrics\":[\"USER\_ID\"],\"filter\_condition\":\"\",\"partition\_desc\":{\"partition\_date\_column\":\"TEST.ODS\_SERVICE\_ORDER\_VIEW.DT\",\"partition\_time\_column\":null,\"partition\_date\_start\":0,\"partition\_date\_format\":\"yyyyMMdd\",\"partition\_time\_format\":\"HH:mm:ss\",\"partition\_type\":\"APPEND\",\"partition\_condition\_builder\":\"org.apache.kylin.metadata.model.PartitionDesc$DefaultPartitionConditionBuilder\"},\"capacity\":\"MEDIUM\"}","successful":false,"message":"","project":"user\_register\_project"}' http://172.17.1.183:7070/kylin/api/models
响应:
{
"uuid": "7edea2a5-4967-4c19-81ad-aafb513d5c7c",
"modelName": "user\_active\_model\_create\_test",
"modelDescData": "{\"uuid\":\"\",\"last\_modified\":0,\"version\":\"1.6.0\",\"name\":\"user\_active\_model\_create\_test\",\"owner\":\"ADMIN\",\"description\":\"用户活跃统计模型\",\"fact\_table\":\"TEST.ODS\_SERVICE\_ORDER\_VIEW\",\"lookups\":[],\"dimensions\":[{\"table\":\"TEST.ODS\_SERVICE\_ORDER\_VIEW\",\"columns\":[\"DM\_CITY\_NAME\",\"DM\_CORPORATE\_TYPE\",\"DM\_IS\_TEST\_USER\",\"DM\_ORDER\_SOURCE\",\"DM\_ORDER\_STATUS\",\"DM\_ORIGIN\_AMOUNT\_COMPARE\",\"DT\"]}],\"metrics\":[\"USER\_ID\"],\"filter\_condition\":\"\",\"partition\_desc\":{\"partition\_date\_column\":\"TEST.ODS\_SERVICE\_ORDER\_VIEW.DT\",\"partition\_time\_column\":null,\"partition\_date\_start\":0,\"partition\_date\_format\":\"yyyyMMdd\",\"partition\_time\_format\":\"HH:mm:ss\",\"partition\_type\":\"APPEND\",\"partition\_condition\_builder\":\"org.apache.kylin.metadata.model.PartitionDesc$DefaultPartitionConditionBuilder\"},\"capacity\":\"MEDIUM\"}",
"successful": true,
"message": "",
"project": "user\_register\_project"
}
drop model
{modelName}
curl -X DELETE -H "Authorization: Basic QURNSU46S1lMSU4=" -H "Content-Type: application/json" http://172.17.1.183:7070/kylin/api/models/user\_active\_model\_create\_test
Cube API
cube base url:
http://{host}:{port}/kylin/api/cubes
create cube
- request:
POST http://{host}:{port}/kylin/api/cubes
- param:
{
"uuid": "",
"cubeName": "driver_active_count_cube_create_test",
"cubeDescData": "{\"uuid\":\"\",\"last_modified\":0,\"version\":\"1.6.0\",\"name\":\"driver_active_count_cube_create_test\",\"model_name\":\"driver_active_model\",\"description\":\"\",\"null_string\":null,\"dimensions\":[{\"name\":\"DM_CITY_NAME\",\"table\":\"TEST.ODS_SERVICE_ORDER_DRIVER_VIEW\",\"column\":\"DM_CITY_NAME\",\"derived\":null},{\"name\":\"DM_CAR_TYPE_ID\",\"table\":\"TEST.ODS_SERVICE_ORDER_DRIVER_VIEW\",\"column\":\"DM_CAR_TYPE_ID\",\"derived\":null},{\"name\":\"DM_CORPORATE_TYPE\",\"table\":\"TEST.ODS_SERVICE_ORDER_DRIVER_VIEW\",\"column\":\"DM_CORPORATE_TYPE\",\"derived\":null},{\"name\":\"DM_IS_TEST_USER\",\"table\":\"TEST.ODS_SERVICE_ORDER_DRIVER_VIEW\",\"column\":\"DM_IS_TEST_USER\",\"derived\":null},{\"name\":\"DM_ORDER_SOURCE\",\"table\":\"TEST.ODS_SERVICE_ORDER_DRIVER_VIEW\",\"column\":\"DM_ORDER_SOURCE\",\"derived\":null},{\"name\":\"DM_ORDER_STATUS\",\"table\":\"TEST.ODS_SERVICE_ORDER_DRIVER_VIEW\",\"column\":\"DM_ORDER_STATUS\",\"derived\":null},{\"name\":\"DT\",\"table\":\"TEST.ODS_SERVICE_ORDER_DRIVER_VIEW\",\"column\":\"DT\",\"derived\":null}],\"measures\":[{\"name\":\"_COUNT_\",\"function\":{\"expression\":\"COUNT\",\"parameter\":{\"type\":\"constant\",\"value\":\"1\",\"next_parameter\":null},\"returntype\":\"bigint\"},\"dependent_measure_ref\":null},{\"name\":\"COUNT_DISTINCT_DRIVERID\",\"function\":{\"expression\":\"COUNT_DISTINCT\",\"parameter\":{\"type\":\"column\",\"value\":\"DRIVER_ID\",\"next_parameter\":null},\"returntype\":\"bitmap\"},\"dependent_measure_ref\":null}],\"dictionaries\":[{\"column\":\"DRIVER_ID\",\"builder\":\"org.apache.kylin.dict.GlobalDictionaryBuilder\"}],\"rowkey\":{\"rowkey_columns\":[{\"column\":\"DM_CITY_NAME\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DT\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DM_CAR_TYPE_ID\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DM_CORPORATE_TYPE\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DM_IS_TEST_USER\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DM_ORDER_SOURCE\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DM_ORDER_STATUS\",\"encoding\":\"dict\",\"isShardBy\":false}]},\"hbase_mapping\":{\"column_family\":[{\"name\":\"F1\",\"columns\":[{\"qualifier\":\"M\",\"measure_refs\":[\"\_COUNT\_\"]}]},{\"name\":\"F2\",\"columns\":[{\"qualifier\":\"M\",\"measure_refs\":[\"COUNT_DISTINCT_DRIVERID\"]}]}]},\"aggregation_groups\":[{\"includes\":[\"DM_CITY_NAME\",\"DM_CAR_TYPE_ID\",\"DM_CORPORATE_TYPE\",\"DM_IS_TEST_USER\",\"DM_ORDER_SOURCE\",\"DM_ORDER_STATUS\",\"DT\"],\"select_rule\":{\"hierarchy_dims\":[],\"mandatory_dims\":[],\"joint_dims\":[]}}],\"signature\":\"jtIgIPDisuGT6KAFHhskeQ==\",\"notify_list\":[],\"status_need_notify\":[\"ERROR\",\"DISCARDED\",\"SUCCEED\"],\"partition_date_start\":0,\"partition_date_end\":3153600000000,\"auto_merge_time_ranges\":[604800000,2419200000],\"retention_range\":0,\"engine_type\":2,\"storage_type\":2,\"override_kylin_properties\":{}}",
"streamingData": "",
"kafkaData": "",
"successful": false,
"message": "",
"project": "user_register_project",
"streamingCube": ""
}
- example:
curl -X POST -H "Authorization: Basic QURNSU46S1lMSU4=" -H "Content-Type: application/json" -d '{"uuid":"","cubeName":"driver_active_count_cube_create_test","cubeDescData":"{\"uuid\":\"\",\"last_modified\":0,\"version\":\"1.6.0\",\"name\":\"driver_active_count_cube_create_test\",\"model_name\":\"driver_active_model\",\"description\":\"\",\"null_string\":null,\"dimensions\":[{\"name\":\"DM_CITY_NAME\",\"table\":\"TEST.ODS_SERVICE_ORDER_DRIVER_VIEW\",\"column\":\"DM_CITY_NAME\",\"derived\":null},{\"name\":\"DM_CAR_TYPE_ID\",\"table\":\"TEST.ODS_SERVICE_ORDER_DRIVER_VIEW\",\"column\":\"DM_CAR_TYPE_ID\",\"derived\":null},{\"name\":\"DM_CORPORATE_TYPE\",\"table\":\"TEST.ODS_SERVICE_ORDER_DRIVER_VIEW\",\"column\":\"DM_CORPORATE_TYPE\",\"derived\":null},{\"name\":\"DM_IS_TEST_USER\",\"table\":\"TEST.ODS_SERVICE_ORDER_DRIVER_VIEW\",\"column\":\"DM_IS_TEST_USER\",\"derived\":null},{\"name\":\"DM_ORDER_SOURCE\",\"table\":\"TEST.ODS_SERVICE_ORDER_DRIVER_VIEW\",\"column\":\"DM_ORDER_SOURCE\",\"derived\":null},{\"name\":\"DM_ORDER_STATUS\",\"table\":\"TEST.ODS_SERVICE_ORDER_DRIVER_VIEW\",\"column\":\"DM_ORDER_STATUS\",\"derived\":null},{\"name\":\"DT\",\"table\":\"TEST.ODS_SERVICE_ORDER_DRIVER_VIEW\",\"column\":\"DT\",\"derived\":null}],\"measures\":[{\"name\":\"_COUNT_\",\"function\":{\"expression\":\"COUNT\",\"parameter\":{\"type\":\"constant\",\"value\":\"1\",\"next_parameter\":null},\"returntype\":\"bigint\"},\"dependent_measure_ref\":null},{\"name\":\"COUNT_DISTINCT_DRIVERID\",\"function\":{\"expression\":\"COUNT_DISTINCT\",\"parameter\":{\"type\":\"column\",\"value\":\"DRIVER_ID\",\"next_parameter\":null},\"returntype\":\"bitmap\"},\"dependent_measure_ref\":null}],\"dictionaries\":[{\"column\":\"DRIVER_ID\",\"builder\":\"org.apache.kylin.dict.GlobalDictionaryBuilder\"}],\"rowkey\":{\"rowkey_columns\":[{\"column\":\"DM_CITY_NAME\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DT\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DM_CAR_TYPE_ID\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DM_CORPORATE_TYPE\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DM_IS_TEST_USER\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DM_ORDER_SOURCE\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DM_ORDER_STATUS\",\"encoding\":\"dict\",\"isShardBy\":false}]},\"hbase_mapping\":{\"column_family\":[{\"name\":\"F1\",\"columns\":[{\"qualifier\":\"M\",\"measure_refs\":[\"_COUNT_\"]}]},{\"name\":\"F2\",\"columns\":[{\"qualifier\":\"M\",\"measure_refs\":[\"COUNT_DISTINCT_DRIVERID\"]}]}]},\"aggregation_groups\":[{\"includes\":[\"DM_CITY_NAME\",\"DM_CAR_TYPE_ID\",\"DM_CORPORATE_TYPE\",\"DM_IS_TEST_USER\",\"DM_ORDER_SOURCE\",\"DM_ORDER_STATUS\",\"DT\"],\"select_rule\":{\"hierarchy_dims\":[],\"mandatory_dims\":[],\"joint_dims\":[]}}],\"signature\":\"jtIgIPDisuGT6KAFHhskeQ==\",\"notify_list\":[],\"status_need_notify\":[\"ERROR\",\"DISCARDED\",\"SUCCEED\"],\"partition_date_start\":0,\"partition_date_end\":3153600000000,\"auto_merge_time_ranges\":[604800000,2419200000],\"retention_range\":0,\"engine_type\":2,\"storage_type\":2,\"override_kylin_properties\":{}}","streamingData":"","kafkaData":"","successful":false,"message":"","project":"user_register_project","streamingCube":""}' http://172.17.1.183:7070/kylin/api/cubes
响应:
{
"uuid": "0d1ff1a1-d9fc-418d-a689-bfe4328f3e48",
"cubeName": "driver\_active\_count\_cube\_create\_test",
"cubeDescData": "{\"uuid\":\"\",\"last\_modified\":0,\"version\":\"1.6.0\",\"name\":\"driver\_active\_count\_cube\_create\_test\",\"model\_name\":\"driver\_active\_model\",\"description\":\"\",\"null\_string\":null,\"dimensions\":[{\"name\":\"DM\_CITY\_NAME\",\"table\":\"TEST.ODS\_SERVICE\_ORDER\_DRIVER\_VIEW\",\"column\":\"DM\_CITY\_NAME\",\"derived\":null},{\"name\":\"DM\_CAR\_TYPE\_ID\",\"table\":\"TEST.ODS\_SERVICE\_ORDER\_DRIVER\_VIEW\",\"column\":\"DM\_CAR\_TYPE\_ID\",\"derived\":null},{\"name\":\"DM\_CORPORATE\_TYPE\",\"table\":\"TEST.ODS\_SERVICE\_ORDER\_DRIVER\_VIEW\",\"column\":\"DM\_CORPORATE\_TYPE\",\"derived\":null},{\"name\":\"DM\_IS\_TEST\_USER\",\"table\":\"TEST.ODS\_SERVICE\_ORDER\_DRIVER\_VIEW\",\"column\":\"DM\_IS\_TEST\_USER\",\"derived\":null},{\"name\":\"DM\_ORDER\_SOURCE\",\"table\":\"TEST.ODS\_SERVICE\_ORDER\_DRIVER\_VIEW\",\"column\":\"DM\_ORDER\_SOURCE\",\"derived\":null},{\"name\":\"DM\_ORDER\_STATUS\",\"table\":\"TEST.ODS\_SERVICE\_ORDER\_DRIVER\_VIEW\",\"column\":\"DM\_ORDER\_STATUS\",\"derived\":null},{\"name\":\"DT\",\"table\":\"TEST.ODS\_SERVICE\_ORDER\_DRIVER\_VIEW\",\"column\":\"DT\",\"derived\":null}],\"measures\":[{\"name\":\"\_COUNT\_\",\"function\":{\"expression\":\"COUNT\",\"parameter\":{\"type\":\"constant\",\"value\":\"1\",\"next\_parameter\":null},\"returntype\":\"bigint\"},\"dependent\_measure\_ref\":null},{\"name\":\"COUNT\_DISTINCT\_DRIVERID\",\"function\":{\"expression\":\"COUNT\_DISTINCT\",\"parameter\":{\"type\":\"column\",\"value\":\"DRIVER\_ID\",\"next\_parameter\":null},\"returntype\":\"bitmap\"},\"dependent\_measure\_ref\":null}],\"dictionaries\":[{\"column\":\"DRIVER\_ID\",\"builder\":\"org.apache.kylin.dict.GlobalDictionaryBuilder\"}],\"rowkey\":{\"rowkey\_columns\":[{\"column\":\"DM\_CITY\_NAME\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DT\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DM\_CAR\_TYPE\_ID\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DM\_CORPORATE\_TYPE\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DM\_IS\_TEST\_USER\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DM\_ORDER\_SOURCE\",\"encoding\":\"dict\",\"isShardBy\":false},{\"column\":\"DM\_ORDER\_STATUS\",\"encoding\":\"dict\",\"isShardBy\":false}]},\"hbase\_mapping\":{\"column\_family\":[{\"name\":\"F1\",\"columns\":[{\"qualifier\":\"M\",\"measure\_refs\":[\"\_COUNT\_\"]}]},{\"name\":\"F2\",\"columns\":[{\"qualifier\":\"M\",\"measure\_refs\":[\"COUNT\_DISTINCT\_DRIVERID\"]}]}]},\"aggregation\_groups\":[{\"includes\":[\"DM\_CITY\_NAME\",\"DM\_CAR\_TYPE\_ID\",\"DM\_CORPORATE\_TYPE\",\"DM\_IS\_TEST\_USER\",\"DM\_ORDER\_SOURCE\",\"DM\_ORDER\_STATUS\",\"DT\"],\"select\_rule\":{\"hierarchy\_dims\":[],\"mandatory\_dims\":[],\"joint\_dims\":[]}}],\"signature\":\"jtIgIPDisuGT6KAFHhskeQ==\",\"notify\_list\":[],\"status\_need\_notify\":[\"ERROR\",\"DISCARDED\",\"SUCCEED\"],\"partition\_date\_start\":0,\"partition\_date\_end\":3153600000000,\"auto\_merge\_time\_ranges\":[604800000,2419200000],\"retention\_range\":0,\"engine\_type\":2,\"storage\_type\":2,\"override\_kylin\_properties\":{}}",
"streamingData": "",
"kafkaData": "",
"successful": true,
"message": "",
"project": "user\_register\_project",
"streamingCube": ""
}
drop cube
{cubeName}
build cube
{cubeName},{ "startTime": 0, "endTime": 0, "buildType": "BUILD"}
- example:
curl -X PUT -H "Authorization: Basic QURNSU46S1lMSU4=" -H "Content-Type: application/json;charset=utf-8" -d '{ "startTime": 0, "endTime": 0, "buildType": "BUILD"}' http://172.17.1.183:7070/kylin/api/cubes/user_register_cude_of_model3/build
响应:
{
"uuid": "f7960e96-ad9b-4004-9215-4671ba3a76f5",
"last\_modified": 1506305725793,
"version": "1.6.0",
"name": "user\_register\_cude\_of\_model3 - 19700101000000\_2922789940817071255 - BUILD - GMT+08:00 2017-09-25 10:15:25",
"type": "BUILD",
"duration": 0,
"related\_cube": "user\_register\_cude\_of\_model3",
"related\_segment": "57ca7b73-c7d6-4b85-91b8-e4abb8d88015",
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"mr\_waiting": 0,
"steps": [
{
"interruptCmd": null,
"id": "f7960e96-ad9b-4004-9215-4671ba3a76f5-00",
"name": "Create Intermediate Flat Hive Table",
"sequence\_id": 0,
"exec\_cmd": null,
"interrupt\_cmd": null,
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"exec\_wait\_time": 0,
"step\_status": "PENDING",
"cmd\_type": "SHELL\_CMD\_HADOOP",
"info": {},
"run\_async": false
},
{
"interruptCmd": null,
"id": "f7960e96-ad9b-4004-9215-4671ba3a76f5-01",
"name": "Redistribute Flat Hive Table",
"sequence\_id": 1,
"exec\_cmd": null,
"interrupt\_cmd": null,
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"exec\_wait\_time": 0,
"step\_status": "PENDING",
"cmd\_type": "SHELL\_CMD\_HADOOP",
"info": {},
"run\_async": false
},
{
"interruptCmd": null,
"id": "f7960e96-ad9b-4004-9215-4671ba3a76f5-02",
"name": "Extract Fact Table Distinct Columns",
"sequence\_id": 2,
"exec\_cmd": " -conf /opt/apache-kylin-1.6.0-hbase1.x-bin/conf/kylin\_job\_conf.xml -cubename user\_register\_cude\_of\_model3 -output /kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/fact\_distinct\_columns -segmentid 57ca7b73-c7d6-4b85-91b8-e4abb8d88015 -statisticsenabled true -statisticsoutput /kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/statistics -statisticssamplingpercent 100 -jobname Kylin\_Fact\_Distinct\_Columns\_user\_register\_cude\_of\_model3\_Step -cubingJobId f7960e96-ad9b-4004-9215-4671ba3a76f5",
"interrupt\_cmd": null,
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"exec\_wait\_time": 0,
"step\_status": "PENDING",
"cmd\_type": "SHELL\_CMD\_HADOOP",
"info": {},
"run\_async": false
},
{
"interruptCmd": null,
"id": "f7960e96-ad9b-4004-9215-4671ba3a76f5-03",
"name": "Build Dimension Dictionary",
"sequence\_id": 3,
"exec\_cmd": " -cubename user\_register\_cude\_of\_model3 -segmentid 57ca7b73-c7d6-4b85-91b8-e4abb8d88015 -input /kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/fact\_distinct\_columns",
"interrupt\_cmd": null,
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"exec\_wait\_time": 0,
"step\_status": "PENDING",
"cmd\_type": "SHELL\_CMD\_HADOOP",
"info": {},
"run\_async": false
},
{
"interruptCmd": null,
"id": "f7960e96-ad9b-4004-9215-4671ba3a76f5-04",
"name": "Save Cuboid Statistics",
"sequence\_id": 4,
"exec\_cmd": null,
"interrupt\_cmd": null,
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"exec\_wait\_time": 0,
"step\_status": "PENDING",
"cmd\_type": "SHELL\_CMD\_HADOOP",
"info": {},
"run\_async": false
},
{
"interruptCmd": null,
"id": "f7960e96-ad9b-4004-9215-4671ba3a76f5-05",
"name": "Create HTable",
"sequence\_id": 5,
"exec\_cmd": " -cubename user\_register\_cude\_of\_model3 -segmentid 57ca7b73-c7d6-4b85-91b8-e4abb8d88015 -partitions hdfs://yongchet:/kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/rowkey\_stats/part-r-00000 -statisticsenabled true",
"interrupt\_cmd": null,
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"exec\_wait\_time": 0,
"step\_status": "PENDING",
"cmd\_type": "SHELL\_CMD\_HADOOP",
"info": {},
"run\_async": false
},
{
"interruptCmd": null,
"id": "f7960e96-ad9b-4004-9215-4671ba3a76f5-06",
"name": "Build Base Cuboid Data",
"sequence\_id": 6,
"exec\_cmd": " -conf /opt/apache-kylin-1.6.0-hbase1.x-bin/conf/kylin\_job\_conf.xml -cubename user\_register\_cude\_of\_model3 -segmentid 57ca7b73-c7d6-4b85-91b8-e4abb8d88015 -input FLAT\_TABLE -output /kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/cuboid/base\_cuboid -jobname Kylin\_Base\_Cuboid\_Builder\_user\_register\_cude\_of\_model3 -level 0 -cubingJobId f7960e96-ad9b-4004-9215-4671ba3a76f5",
"interrupt\_cmd": null,
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"exec\_wait\_time": 0,
"step\_status": "PENDING",
"cmd\_type": "SHELL\_CMD\_HADOOP",
"info": {},
"run\_async": false
},
{
"interruptCmd": null,
"id": "f7960e96-ad9b-4004-9215-4671ba3a76f5-07",
"name": "Build N-Dimension Cuboid Data : 4-Dimension",
"sequence\_id": 7,
"exec\_cmd": " -conf /opt/apache-kylin-1.6.0-hbase1.x-bin/conf/kylin\_job\_conf.xml -cubename user\_register\_cude\_of\_model3 -segmentid 57ca7b73-c7d6-4b85-91b8-e4abb8d88015 -input /kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/cuboid/base\_cuboid -output /kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/cuboid/4d\_cuboid -jobname Kylin\_ND-Cuboid\_Builder\_user\_register\_cude\_of\_model3\_Step -level 1 -cubingJobId f7960e96-ad9b-4004-9215-4671ba3a76f5",
"interrupt\_cmd": null,
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"exec\_wait\_time": 0,
"step\_status": "PENDING",
"cmd\_type": "SHELL\_CMD\_HADOOP",
"info": {},
"run\_async": false
},
{
"interruptCmd": null,
"id": "f7960e96-ad9b-4004-9215-4671ba3a76f5-08",
"name": "Build N-Dimension Cuboid Data : 3-Dimension",
"sequence\_id": 8,
"exec\_cmd": " -conf /opt/apache-kylin-1.6.0-hbase1.x-bin/conf/kylin\_job\_conf.xml -cubename user\_register\_cude\_of\_model3 -segmentid 57ca7b73-c7d6-4b85-91b8-e4abb8d88015 -input /kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/cuboid/4d\_cuboid -output /kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/cuboid/3d\_cuboid -jobname Kylin\_ND-Cuboid\_Builder\_user\_register\_cude\_of\_model3\_Step -level 2 -cubingJobId f7960e96-ad9b-4004-9215-4671ba3a76f5",
"interrupt\_cmd": null,
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"exec\_wait\_time": 0,
"step\_status": "PENDING",
"cmd\_type": "SHELL\_CMD\_HADOOP",
"info": {},
"run\_async": false
},
{
"interruptCmd": null,
"id": "f7960e96-ad9b-4004-9215-4671ba3a76f5-09",
"name": "Build N-Dimension Cuboid Data : 2-Dimension",
"sequence\_id": 9,
"exec\_cmd": " -conf /opt/apache-kylin-1.6.0-hbase1.x-bin/conf/kylin\_job\_conf.xml -cubename user\_register\_cude\_of\_model3 -segmentid 57ca7b73-c7d6-4b85-91b8-e4abb8d88015 -input /kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/cuboid/3d\_cuboid -output /kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/cuboid/2d\_cuboid -jobname Kylin\_ND-Cuboid\_Builder\_user\_register\_cude\_of\_model3\_Step -level 3 -cubingJobId f7960e96-ad9b-4004-9215-4671ba3a76f5",
"interrupt\_cmd": null,
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"exec\_wait\_time": 0,
"step\_status": "PENDING",
"cmd\_type": "SHELL\_CMD\_HADOOP",
"info": {},
"run\_async": false
},
{
"interruptCmd": null,
"id": "f7960e96-ad9b-4004-9215-4671ba3a76f5-10",
"name": "Build N-Dimension Cuboid Data : 1-Dimension",
"sequence\_id": 10,
"exec\_cmd": " -conf /opt/apache-kylin-1.6.0-hbase1.x-bin/conf/kylin\_job\_conf.xml -cubename user\_register\_cude\_of\_model3 -segmentid 57ca7b73-c7d6-4b85-91b8-e4abb8d88015 -input /kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/cuboid/2d\_cuboid -output /kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/cuboid/1d\_cuboid -jobname Kylin\_ND-Cuboid\_Builder\_user\_register\_cude\_of\_model3\_Step -level 4 -cubingJobId f7960e96-ad9b-4004-9215-4671ba3a76f5",
"interrupt\_cmd": null,
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"exec\_wait\_time": 0,
"step\_status": "PENDING",
"cmd\_type": "SHELL\_CMD\_HADOOP",
"info": {},
"run\_async": false
},
{
"interruptCmd": null,
"id": "f7960e96-ad9b-4004-9215-4671ba3a76f5-11",
"name": "Build N-Dimension Cuboid Data : 0-Dimension",
"sequence\_id": 11,
"exec\_cmd": " -conf /opt/apache-kylin-1.6.0-hbase1.x-bin/conf/kylin\_job\_conf.xml -cubename user\_register\_cude\_of\_model3 -segmentid 57ca7b73-c7d6-4b85-91b8-e4abb8d88015 -input /kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/cuboid/1d\_cuboid -output /kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/cuboid/0d\_cuboid -jobname Kylin\_ND-Cuboid\_Builder\_user\_register\_cude\_of\_model3\_Step -level 5 -cubingJobId f7960e96-ad9b-4004-9215-4671ba3a76f5",
"interrupt\_cmd": null,
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"exec\_wait\_time": 0,
"step\_status": "PENDING",
"cmd\_type": "SHELL\_CMD\_HADOOP",
"info": {},
"run\_async": false
},
{
"interruptCmd": null,
"id": "f7960e96-ad9b-4004-9215-4671ba3a76f5-12",
"name": "Build Cube",
"sequence\_id": 12,
"exec\_cmd": " -conf /opt/apache-kylin-1.6.0-hbase1.x-bin/conf/kylin\_job\_conf\_inmem.xml -cubename user\_register\_cude\_of\_model3 -segmentid 57ca7b73-c7d6-4b85-91b8-e4abb8d88015 -output /kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/cuboid/ -jobname Kylin\_Cube\_Builder\_user\_register\_cude\_of\_model3 -cubingJobId f7960e96-ad9b-4004-9215-4671ba3a76f5",
"interrupt\_cmd": null,
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"exec\_wait\_time": 0,
"step\_status": "PENDING",
"cmd\_type": "SHELL\_CMD\_HADOOP",
"info": {},
"run\_async": false
},
{
"interruptCmd": null,
"id": "f7960e96-ad9b-4004-9215-4671ba3a76f5-13",
"name": "Convert Cuboid Data to HFile",
"sequence\_id": 13,
"exec\_cmd": " -conf /opt/apache-kylin-1.6.0-hbase1.x-bin/conf/kylin\_job\_conf.xml -cubename user\_register\_cude\_of\_model3 -partitions hdfs://yongchet:/kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/rowkey\_stats/part-r-00000\_hfile -input /kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/cuboid/* -output hdfs://yongchet:/kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/hfile -htablename KYLIN\_VQPC575AHJ -jobname Kylin\_HFile\_Generator\_user\_register\_cude\_of\_model3\_Step",
"interrupt\_cmd": null,
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"exec\_wait\_time": 0,
"step\_status": "PENDING",
"cmd\_type": "SHELL\_CMD\_HADOOP",
"info": {},
"run\_async": false
},
{
"interruptCmd": null,
"id": "f7960e96-ad9b-4004-9215-4671ba3a76f5-14",
"name": "Load HFile to HBase Table",
"sequence\_id": 14,
"exec\_cmd": " -input hdfs://yongchet:/kylin/kylin\_metadata/kylin-f7960e96-ad9b-4004-9215-4671ba3a76f5/user\_register\_cude\_of\_model3/hfile -htablename KYLIN\_VQPC575AHJ -cubename user\_register\_cude\_of\_model3",
"interrupt\_cmd": null,
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"exec\_wait\_time": 0,
"step\_status": "PENDING",
"cmd\_type": "SHELL\_CMD\_HADOOP",
"info": {},
"run\_async": false
},
{
"interruptCmd": null,
"id": "f7960e96-ad9b-4004-9215-4671ba3a76f5-15",
"name": "Update Cube Info",
"sequence\_id": 15,
"exec\_cmd": null,
"interrupt\_cmd": null,
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"exec\_wait\_time": 0,
"step\_status": "PENDING",
"cmd\_type": "SHELL\_CMD\_HADOOP",
"info": {},
"run\_async": false
},
{
"interruptCmd": null,
"id": "f7960e96-ad9b-4004-9215-4671ba3a76f5-16",
"name": "Hive Cleanup",
"sequence\_id": 16,
"exec\_cmd": null,
"interrupt\_cmd": null,
"exec\_start\_time": 0,
"exec\_end\_time": 0,
"exec\_wait\_time": 0,
"step\_status": "PENDING",
"cmd\_type": "SHELL\_CMD\_HADOOP",
"info": {},
"run\_async": false
}
],
"submitter": "ADMIN",
"job\_status": "PENDING",
"progress": 0
}
Query API
Query base url:
http://{host}:{port}/kylin/api/query
query data
- request:
POST http://{host}:{port}/kylin/api/query
- param:
{
"sql": "select count(distinct driver_id),dt from ods_service_order_driver_all_view group by dt order by dt",
"offset": "0",
"limit": 10,
"project": "user_register_project"
}
- example:
curl -X POST -H "Authorization: Basic QURNSU46S1lMSU4=" -H "Content-Type: application/json" -d '{ "sql":"select count(distinct driver\_id),dt from ods\_service\_order\_driver\_all\_view group by dt order by dt", "offset":"0", "limit":10, "project":"user\_register\_project"}' http://172.17.1.183:7070/kylin/api/query
响应:
{
"columnMetas": [
{
"isNullable": 0,
"displaySize": 19,
"label": "EXPR$0",
"name": "EXPR$0",
"schemaName": null,
"catelogName": null,
"tableName": null,
"precision": 19,
"scale": 0,
"columnType": -5,
"columnTypeName": "BIGINT",
"autoIncrement": false,
"caseSensitive": true,
"searchable": false,
"currency": false,
"signed": true,
"definitelyWritable": false,
"writable": false,
"readOnly": true
},
{
"isNullable": 1,
"displaySize": 256,
"label": "DT",
"name": "DT",
"schemaName": "TEST",
"catelogName": null,
"tableName": "ODS\_SERVICE\_ORDER\_DRIVER\_ALL\_VIEW",
"precision": 256,
"scale": 0,
"columnType": 12,
"columnTypeName": "VARCHAR",
"autoIncrement": false,
"caseSensitive": true,
"searchable": false,
"currency": false,
"signed": true,
"definitelyWritable": false,
"writable": false,
"readOnly": true
}
],
"results": [
[
"100365",
"20170101"
],
[
"109240",
"20170102"
],
[
"118238",
"20170103"
],
[
"120234",
"20170104"
],
[
"121958",
"20170105"
],
[
"123549",
"20170106"
],
[
"113853",
"20170107"
],
[
"107214",
"20170108"
],
[
"111119",
"20170109"
],
[
"109505",
"20170110"
]
],
"cube": "driver\_active\_all\_cube",
"affectedRowCount": 0,
"isException": false,
"exceptionMessage": null,
"duration": 1205,
"totalScanCount": 262,
"hitExceptionCache": false,
"storageCacheUsed": false,
"partial": false
}