RESTful API

This page lists the major RESTful APIs provided by Kylin.
* Authentication
* Authentication
* Query
* Query
* Prepare query
* Save query
* Remove saved query
* Get saved queries
* Get running queries
* Stop query
* List queryable tables
* CUBE
* Create cube
* Update cube
* List cubes
* Get cube
* Get cube descriptor (dimension, measure info, etc)
* Get data model (fact and lookup table info)
* Build cube
* Enable cube
* Disable cube
* Purge cube
* Delete segment
* Auto-Merge segment
* Get sql of a cube
* Get sql of a cube segment
* Force rebuild lookup table snapshot
* Clone cube
* Delete Cube
* Get hbase info
* Get current cuboid
* Migrate cube
* MODEL
* Create model
* Update model
* Get modelDescData
* Delete model
* Clone model
* JOB
* Resume job
* Pause job
* Drop job
* Discard job
* Get job status
* Get job step output
* Get job list
* Get job status overview
* Resubmit realtime build job
* Rollback job
* Metadata
* Get Hive Table
* Get Hive Tables
* Load Hive Tables
* Unload Hive Tables
* Show databases in hive
* Show tables in a hive database
* Cache
* Wipe cache
* Announce wipe cache
* Hot load kylin config
* Streaming
* Initiate cube start position
* Build stream cube
* Check segment holes
* Fill segment holes
* Get streaming configs
* Get Kafka configs
* Create streaming schema
* Update streaming tables
* ACL
* Get users can query the table
* Get users cannot query the table
* Put user to table blacklist
* Delete user from table blacklist

Authentication

POST /kylin/api/user/authentication

Request Header

Authorization data encoded by basic auth is needed in the header, such as:
Authorization:Basic {data}
You can generate {data} by using below python script
python -c "import base64; print base64.standard_b64encode('$UserName:$Password')"

Response Body

  • userDetails - Defined authorities and status of current user.

Response Sample

  1. {
  2. "userDetails": {
  3. "username": "sample",
  4. "password": "null",
  5. "authorities": [
  6. {
  7. "authority": "ROLE_ADMIN"
  8. },
  9. {
  10. "authority": "ROLE_ANALYST"
  11. },
  12. {
  13. "authority": "ROLE_MODELER"
  14. },
  15. {
  16. "authority": "ALL_USERS"
  17. }
  18. ],
  19. "disabled": false,
  20. "defaultPassword": false,
  21. "locked": false,
  22. "lockedTime": 0,
  23. "wrongTime": 0,
  24. "uuid": "3704ba8c-deb1-ac47-729d-c1039c1bd6ec",
  25. "last_modified": 1585219480112,
  26. "version": "3.0.0.20500"
  27. }
  28. }

Curl Example

  1. curl -c /path/to/cookiefile.txt -X POST -H "Authorization: Basic XXXXXXXXX" -H 'Content-Type: application/json' http://<host>:<port>/kylin/api/user/authentication

If login successfully, the JSESSIONID will be saved into the cookie file; In the subsequent http requests, attach the cookie, for example:

  1. curl -b /path/to/cookiefile.txt -X PUT -H 'Content-Type: application/json' -d '{"startTime":'1423526400000', "endTime":'1423612800000', "buildType":"BUILD"}' http://<host>:<port>/kylin/api/cubes/your_cube/build

Alternatively, you can provide the username/password with option “user” in each curl call; please note this has the risk of password leak in shell history:

  1. curl -X PUT --user ADMIN:KYLIN -H "Content-Type: application/json;charset=utf-8" -d '{ "startTime": 820454400000, "endTime": 821318400000, "buildType": "BUILD"}' http://localhost:7070/kylin/api/cubes/kylin_sales/build

Query

POST /kylin/api/query

Request Body

  • sql - required string The text of sql statement.
  • offset - optional int Query offset. If offset is set in sql, curIndex will be ignored.
  • limit - optional int Query limit. If limit is set in sql, perPage will be ignored.
  • acceptPartial - optional bool Whether accept a partial result or not, default be “false”. Set to “false” for production use.
  • project - optional string Project to perform query. Default value is ‘DEFAULT’.

Request Sample

  1. {
  2. "sql":"select * from TEST_KYLIN_FACT",
  3. "offset":0,
  4. "limit":50000,
  5. "acceptPartial":false,
  6. "project":"DEFAULT"
  7. }

Curl Example

  1. curl -X POST -H "Authorization: Basic XXXXXXXXX" -H "Content-Type: application/json" -d '{ "sql":"select count(*) from TEST_KYLIN_FACT", "project":"learn_kylin" }' http://localhost:7070/kylin/api/query

Response Body

  • columnMetas - Column metadata information of result set.
  • results - Data set of result.
  • cube - Cube used for this query.
  • affectedRowCount - Count of affected row by this sql statement.
  • isException - Whether this response is an exception.
  • ExceptionMessage - Message content of the exception.
  • Duration - Time cost of this query
  • Partial - Whether the response is a partial result or not. Decided by acceptPartial of request.

Response Sample

  1. {
  2. "columnMetas":[
  3. {
  4. "isNullable":1,
  5. "displaySize":0,
  6. "label":"CAL_DT",
  7. "name":"CAL_DT",
  8. "schemaName":null,
  9. "catelogName":null,
  10. "tableName":null,
  11. "precision":0,
  12. "scale":0,
  13. "columnType":91,
  14. "columnTypeName":"DATE",
  15. "readOnly":true,
  16. "writable":false,
  17. "caseSensitive":true,
  18. "searchable":false,
  19. "currency":false,
  20. "signed":true,
  21. "autoIncrement":false,
  22. "definitelyWritable":false
  23. },
  24. {
  25. "isNullable":1,
  26. "displaySize":10,
  27. "label":"LEAF_CATEG_ID",
  28. "name":"LEAF_CATEG_ID",
  29. "schemaName":null,
  30. "catelogName":null,
  31. "tableName":null,
  32. "precision":10,
  33. "scale":0,
  34. "columnType":4,
  35. "columnTypeName":"INTEGER",
  36. "readOnly":true,
  37. "writable":false,
  38. "caseSensitive":true,
  39. "searchable":false,
  40. "currency":false,
  41. "signed":true,
  42. "autoIncrement":false,
  43. "definitelyWritable":false
  44. }
  45. ],
  46. "results":[
  47. [
  48. "2013-08-07",
  49. "32996",
  50. "15",
  51. "15",
  52. "Auction",
  53. "10000000",
  54. "49.048952730908745",
  55. "49.048952730908745",
  56. "49.048952730908745",
  57. "1"
  58. ],
  59. [
  60. "2013-08-07",
  61. "43398",
  62. "0",
  63. "14",
  64. "ABIN",
  65. "10000633",
  66. "85.78317064220418",
  67. "85.78317064220418",
  68. "85.78317064220418",
  69. "1"
  70. ]
  71. ],
  72. "cube":"test_kylin_cube_with_slr_desc",
  73. "affectedRowCount":0,
  74. "isException":false,
  75. "exceptionMessage":null,
  76. "duration":3451,
  77. "partial":false
  78. }

Prepare query

POST /kylin/api/query/prestate

Request Body

  • sql - required string The text of sql statement.
  • offset - optional int Query offset. If offset is set in sql, curIndex will be ignored.
  • limit - optional int Query limit. If limit is set in sql, perPage will be ignored.
  • acceptPartial - optional bool Whether accept a partial result or not, default be “false”. Set to “false” for production use.
  • project - optional string Project to perform query. Default value is ‘DEFAULT’.

Request Sample

  1. {
  2. "sql":"select * from TEST_KYLIN_FACT",
  3. "offset":0,
  4. "limit":50000,
  5. "acceptPartial":false,
  6. "project":"DEFAULT"
  7. }

Save query

POST /kylin/api/saved_queries

Request Body

  • sql - required string The text of sql statement.
  • name - required string Sql name.
  • project - required string Project to perform query.
  • description - optional string Sql description.

Request Sample

  1. {
  2. "sql": "select count(*) from kylin_sales",
  3. "name": "test",
  4. "project": "learn_kylin"
  5. }

Remove saved query

DELETE /kylin/api/saved_queries/{id}

Request Parameters

  • id - required string The id of saved query you want to remove

Get saved queries

GET /kylin/api/saved_queries

Response Sample

  1. [
  2. {
  3. "name": "test",
  4. "project": "learn_kylin",
  5. "sql": "select count(*) from kylin_sales",
  6. "description": null,
  7. "id": "-1674470999"
  8. }
  9. ]

Get running queries

GET /kylin/api/query/runningQueries

Stop Query

PUT /kylin/api/query/{queryId}/stop

Path Variable

  • queryId - required String The queryId of you want to stop. You can obtain it by Get running queries.

List queryable tables

GET /kylin/api/tables_and_columns

Path Variable

  • project - required string The project to load tables

Response Sample

  1. [
  2. {
  3. "columns":[
  4. {
  5. "table_NAME":"TEST_CAL_DT",
  6. "table_SCHEM":"EDW",
  7. "column_NAME":"CAL_DT",
  8. "data_TYPE":91,
  9. "nullable":1,
  10. "column_SIZE":-1,
  11. "buffer_LENGTH":-1,
  12. "decimal_DIGITS":0,
  13. "num_PREC_RADIX":10,
  14. "column_DEF":null,
  15. "sql_DATA_TYPE":-1,
  16. "sql_DATETIME_SUB":-1,
  17. "char_OCTET_LENGTH":-1,
  18. "ordinal_POSITION":1,
  19. "is_NULLABLE":"YES",
  20. "scope_CATLOG":null,
  21. "scope_SCHEMA":null,
  22. "scope_TABLE":null,
  23. "source_DATA_TYPE":-1,
  24. "iS_AUTOINCREMENT":null,
  25. "table_CAT":"defaultCatalog",
  26. "remarks":null,
  27. "type_NAME":"DATE"
  28. },
  29. {
  30. "table_NAME":"TEST_CAL_DT",
  31. "table_SCHEM":"EDW",
  32. "column_NAME":"WEEK_BEG_DT",
  33. "data_TYPE":91,
  34. "nullable":1,
  35. "column_SIZE":-1,
  36. "buffer_LENGTH":-1,
  37. "decimal_DIGITS":0,
  38. "num_PREC_RADIX":10,
  39. "column_DEF":null,
  40. "sql_DATA_TYPE":-1,
  41. "sql_DATETIME_SUB":-1,
  42. "char_OCTET_LENGTH":-1,
  43. "ordinal_POSITION":2,
  44. "is_NULLABLE":"YES",
  45. "scope_CATLOG":null,
  46. "scope_SCHEMA":null,
  47. "scope_TABLE":null,
  48. "source_DATA_TYPE":-1,
  49. "iS_AUTOINCREMENT":null,
  50. "table_CAT":"defaultCatalog",
  51. "remarks":null,
  52. "type_NAME":"DATE"
  53. }
  54. ],
  55. "table_NAME":"TEST_CAL_DT",
  56. "table_SCHEM":"EDW",
  57. "ref_GENERATION":null,
  58. "self_REFERENCING_COL_NAME":null,
  59. "type_SCHEM":null,
  60. "table_TYPE":"TABLE",
  61. "table_CAT":"defaultCatalog",
  62. "remarks":null,
  63. "type_CAT":null,
  64. "type_NAME":null
  65. }
  66. ]

Create cube

POST /kylin/api/cubes

Request Body

  • cubeDescData - required string cubeDescData to create
  • cubeName - required string cubeName to create
  • projectName - required string projectName to which cube belongs

Request Sample

  1. {
  2. "cubeDescData":"{\"uuid\": \"0ef9b7a8-3929-4dff-b59d-2100aadc8dbf\",\"last_modified\": 0,\"version\": \"3.0.0.20500\",\"name\": \"kylin_test_cube\",\"is_draft\": false,\"model_name\": \"kylin_sales_model\",\"description\": \"\",\"null_string\": null,\"dimensions\": [{\"name\": \"TRANS_ID\",\"table\": \"KYLIN_SALES\",\"column\": \"TRANS_ID\",\"derived\": null},{\"name\": \"YEAR_BEG_DT\",\"table\": \"KYLIN_CAL_DT\",\"column\": null,\"derived\": [\"YEAR_BEG_DT\"]},{\"name\": \"MONTH_BEG_DT\",\"table\": \"KYLIN_CAL_DT\",\"column\": null,\"derived\": [\"MONTH_BEG_DT\"]},{\"name\": \"WEEK_BEG_DT\",\"table\": \"KYLIN_CAL_DT\",\"column\": null,\"derived\": [\"WEEK_BEG_DT\"]},{\"name\": \"USER_DEFINED_FIELD1\",\"table\": \"KYLIN_CATEGORY_GROUPINGS\",\"column\": null,\"derived\": [\"USER_DEFINED_FIELD1\"]},{\"name\": \"USER_DEFINED_FIELD3\",\"table\": \"KYLIN_CATEGORY_GROUPINGS\",\"column\": null,\"derived\": [\"USER_DEFINED_FIELD3\"]},{\"name\": \"META_CATEG_NAME\",\"table\": \"KYLIN_CATEGORY_GROUPINGS\",\"column\": \"META_CATEG_NAME\",\"derived\": null},{\"name\": \"CATEG_LVL2_NAME\",\"table\": \"KYLIN_CATEGORY_GROUPINGS\",\"column\": \"CATEG_LVL2_NAME\",\"derived\": null},{\"name\": \"CATEG_LVL3_NAME\",\"table\": \"KYLIN_CATEGORY_GROUPINGS\",\"column\": \"CATEG_LVL3_NAME\",\"derived\": null},{\"name\": \"LSTG_FORMAT_NAME\",\"table\": \"KYLIN_SALES\",\"column\": \"LSTG_FORMAT_NAME\",\"derived\": null},{\"name\": \"SELLER_ID\",\"table\": \"KYLIN_SALES\",\"column\": \"SELLER_ID\",\"derived\": null},{\"name\": \"BUYER_ID\",\"table\": \"KYLIN_SALES\",\"column\": \"BUYER_ID\",\"derived\": null},{\"name\": \"ACCOUNT_BUYER_LEVEL\",\"table\": \"BUYER_ACCOUNT\",\"column\": \"ACCOUNT_BUYER_LEVEL\",\"derived\": null},{\"name\": \"ACCOUNT_SELLER_LEVEL\",\"table\": \"SELLER_ACCOUNT\",\"column\": \"ACCOUNT_SELLER_LEVEL\",\"derived\": null},{\"name\": \"BUYER_COUNTRY\",\"table\": \"BUYER_ACCOUNT\",\"column\": \"ACCOUNT_COUNTRY\",\"derived\": null},{\"name\": \"SELLER_COUNTRY\",\"table\": \"SELLER_ACCOUNT\",\"column\": \"ACCOUNT_COUNTRY\",\"derived\": null},{\"name\": \"BUYER_COUNTRY_NAME\",\"table\": \"BUYER_COUNTRY\",\"column\": \"NAME\",\"derived\": null},{\"name\": \"SELLER_COUNTRY_NAME\",\"table\": \"SELLER_COUNTRY\",\"column\": \"NAME\",\"derived\": null},{\"name\": \"OPS_USER_ID\",\"table\": \"KYLIN_SALES\",\"column\": \"OPS_USER_ID\",\"derived\": null},{\"name\": \"OPS_REGION\",\"table\": \"KYLIN_SALES\",\"column\": \"OPS_REGION\",\"derived\": null}],\"measures\": [{\"name\": \"GMV_SUM\",\"function\": {\"expression\": \"SUM\",\"parameter\": {\"type\": \"column\",\"value\": \"KYLIN_SALES.PRICE\"},\"returntype\": \"decimal(19,4)\"}},{\"name\": \"BUYER_LEVEL_SUM\",\"function\": {\"expression\": \"SUM\",\"parameter\": {\"type\": \"column\",\"value\": \"BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL\"},\"returntype\": \"bigint\"}},{\"name\": \"SELLER_LEVEL_SUM\",\"function\": {\"expression\": \"SUM\",\"parameter\": {\"type\": \"column\",\"value\": \"SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL\"},\"returntype\": \"bigint\"}},{\"name\": \"TRANS_CNT\",\"function\": {\"expression\": \"COUNT\",\"parameter\": {\"type\": \"constant\",\"value\": \"1\"},\"returntype\": \"bigint\"}},{\"name\": \"SELLER_CNT_HLL\",\"function\": {\"expression\": \"COUNT_DISTINCT\",\"parameter\": {\"type\": \"column\",\"value\": \"KYLIN_SALES.SELLER_ID\"},\"returntype\": \"hllc(10)\"}},{\"name\": \"TOP_SELLER\",\"function\": {\"expression\": \"TOP_N\",\"parameter\": {\"type\": \"column\",\"value\": \"KYLIN_SALES.PRICE\",\"next_parameter\": {\"type\": \"column\",\"value\": \"KYLIN_SALES.SELLER_ID\"}},\"returntype\": \"topn(100)\",\"configuration\": {\"topn.encoding.KYLIN_SALES.SELLER_ID\": \"dict\",\"topn.encoding_version.KYLIN_SALES.SELLER_ID\": \"1\"}}}],\"rowkey\": {\"rowkey_columns\": [{\"column\": \"KYLIN_SALES.BUYER_ID\",\"encoding\": \"integer:4\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_SALES.SELLER_ID\",\"encoding\": \"integer:4\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_SALES.TRANS_ID\",\"encoding\": \"integer:4\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_SALES.PART_DT\",\"encoding\": \"date\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_SALES.LEAF_CATEG_ID\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_CATEGORY_GROUPINGS.META_CATEG_NAME\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_CATEGORY_GROUPINGS.CATEG_LVL2_NAME\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_CATEGORY_GROUPINGS.CATEG_LVL3_NAME\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"BUYER_ACCOUNT.ACCOUNT_COUNTRY\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"SELLER_ACCOUNT.ACCOUNT_COUNTRY\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"BUYER_COUNTRY.NAME\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"SELLER_COUNTRY.NAME\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_SALES.LSTG_FORMAT_NAME\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_SALES.LSTG_SITE_ID\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_SALES.OPS_USER_ID\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_SALES.OPS_REGION\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false}]},\"hbase_mapping\": {\"column_family\": [{\"name\": \"F1\",\"columns\": [{\"qualifier\": \"M\",\"measure_refs\": [\"GMV_SUM\",\"BUYER_LEVEL_SUM\",\"SELLER_LEVEL_SUM\",\"TRANS_CNT\"]}]},{\"name\": \"F2\",\"columns\": [{\"qualifier\": \"M\",\"measure_refs\": [\"SELLER_CNT_HLL\",\"TOP_SELLER\"]}]}]},\"aggregation_groups\": [{\"includes\": [\"KYLIN_SALES.PART_DT\",\"KYLIN_CATEGORY_GROUPINGS.META_CATEG_NAME\",\"KYLIN_CATEGORY_GROUPINGS.CATEG_LVL2_NAME\",\"KYLIN_CATEGORY_GROUPINGS.CATEG_LVL3_NAME\",\"KYLIN_SALES.LEAF_CATEG_ID\",\"KYLIN_SALES.LSTG_FORMAT_NAME\",\"KYLIN_SALES.LSTG_SITE_ID\",\"KYLIN_SALES.OPS_USER_ID\",\"KYLIN_SALES.OPS_REGION\",\"BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL\",\"SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL\",\"BUYER_ACCOUNT.ACCOUNT_COUNTRY\",\"SELLER_ACCOUNT.ACCOUNT_COUNTRY\",\"BUYER_COUNTRY.NAME\",\"SELLER_COUNTRY.NAME\"],\"select_rule\": {\"hierarchy_dims\": [[\"KYLIN_CATEGORY_GROUPINGS.META_CATEG_NAME\",\"KYLIN_CATEGORY_GROUPINGS.CATEG_LVL2_NAME\",\"KYLIN_CATEGORY_GROUPINGS.CATEG_LVL3_NAME\",\"KYLIN_SALES.LEAF_CATEG_ID\"]],\"mandatory_dims\": [\"KYLIN_SALES.PART_DT\"],\"joint_dims\": [[\"BUYER_ACCOUNT.ACCOUNT_COUNTRY\",\"BUYER_COUNTRY.NAME\"],[\"SELLER_ACCOUNT.ACCOUNT_COUNTRY\",\"SELLER_COUNTRY.NAME\"],[\"BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL\",\"SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL\"],[\"KYLIN_SALES.LSTG_FORMAT_NAME\",\"KYLIN_SALES.LSTG_SITE_ID\"],[\"KYLIN_SALES.OPS_USER_ID\",\"KYLIN_SALES.OPS_REGION\"]]}}],\"signature\": null,\"notify_list\": [],\"status_need_notify\": [],\"partition_date_start\": 1325376000000,\"partition_date_end\": 3153600000000,\"auto_merge_time_ranges\": [],\"volatile_range\": 0,\"retention_range\": 0,\"engine_type\": 2,\"storage_type\": 2,\"override_kylin_properties\": {\"kylin.cube.aggrgroup.is-mandatory-only-valid\": \"true\",\"kylin.engine.spark.rdd-partition-cut-mb\": \"500\"},\"cuboid_black_list\": [],\"parent_forward\": 3,\"mandatory_dimension_set_list\": [],\"snapshot_table_desc_list\": []}",
  3. "cubeName":"kylin_test_cube",
  4. "project":"learn_kylin"
  5. }

Response Sample

  1. {
  2. "uuid": "7b3faf69-eca8-cc5f-25f9-49b0f0b5d404",
  3. "cubeName": "kylin_test_cube",
  4. "cubeDescData":"{\"uuid\": \"0ef9b7a8-3929-4dff-b59d-2100aadc8dbf\",\"last_modified\": 0,\"version\": \"3.0.0.20500\",\"name\": \"kylin_test_cube\",\"is_draft\": false,\"model_name\": \"kylin_sales_model\",\"description\": \"\",\"null_string\": null,\"dimensions\": [{\"name\": \"TRANS_ID\",\"table\": \"KYLIN_SALES\",\"column\": \"TRANS_ID\",\"derived\": null},{\"name\": \"YEAR_BEG_DT\",\"table\": \"KYLIN_CAL_DT\",\"column\": null,\"derived\": [\"YEAR_BEG_DT\"]},{\"name\": \"MONTH_BEG_DT\",\"table\": \"KYLIN_CAL_DT\",\"column\": null,\"derived\": [\"MONTH_BEG_DT\"]},{\"name\": \"WEEK_BEG_DT\",\"table\": \"KYLIN_CAL_DT\",\"column\": null,\"derived\": [\"WEEK_BEG_DT\"]},{\"name\": \"USER_DEFINED_FIELD1\",\"table\": \"KYLIN_CATEGORY_GROUPINGS\",\"column\": null,\"derived\": [\"USER_DEFINED_FIELD1\"]},{\"name\": \"USER_DEFINED_FIELD3\",\"table\": \"KYLIN_CATEGORY_GROUPINGS\",\"column\": null,\"derived\": [\"USER_DEFINED_FIELD3\"]},{\"name\": \"META_CATEG_NAME\",\"table\": \"KYLIN_CATEGORY_GROUPINGS\",\"column\": \"META_CATEG_NAME\",\"derived\": null},{\"name\": \"CATEG_LVL2_NAME\",\"table\": \"KYLIN_CATEGORY_GROUPINGS\",\"column\": \"CATEG_LVL2_NAME\",\"derived\": null},{\"name\": \"CATEG_LVL3_NAME\",\"table\": \"KYLIN_CATEGORY_GROUPINGS\",\"column\": \"CATEG_LVL3_NAME\",\"derived\": null},{\"name\": \"LSTG_FORMAT_NAME\",\"table\": \"KYLIN_SALES\",\"column\": \"LSTG_FORMAT_NAME\",\"derived\": null},{\"name\": \"SELLER_ID\",\"table\": \"KYLIN_SALES\",\"column\": \"SELLER_ID\",\"derived\": null},{\"name\": \"BUYER_ID\",\"table\": \"KYLIN_SALES\",\"column\": \"BUYER_ID\",\"derived\": null},{\"name\": \"ACCOUNT_BUYER_LEVEL\",\"table\": \"BUYER_ACCOUNT\",\"column\": \"ACCOUNT_BUYER_LEVEL\",\"derived\": null},{\"name\": \"ACCOUNT_SELLER_LEVEL\",\"table\": \"SELLER_ACCOUNT\",\"column\": \"ACCOUNT_SELLER_LEVEL\",\"derived\": null},{\"name\": \"BUYER_COUNTRY\",\"table\": \"BUYER_ACCOUNT\",\"column\": \"ACCOUNT_COUNTRY\",\"derived\": null},{\"name\": \"SELLER_COUNTRY\",\"table\": \"SELLER_ACCOUNT\",\"column\": \"ACCOUNT_COUNTRY\",\"derived\": null},{\"name\": \"BUYER_COUNTRY_NAME\",\"table\": \"BUYER_COUNTRY\",\"column\": \"NAME\",\"derived\": null},{\"name\": \"SELLER_COUNTRY_NAME\",\"table\": \"SELLER_COUNTRY\",\"column\": \"NAME\",\"derived\": null},{\"name\": \"OPS_USER_ID\",\"table\": \"KYLIN_SALES\",\"column\": \"OPS_USER_ID\",\"derived\": null},{\"name\": \"OPS_REGION\",\"table\": \"KYLIN_SALES\",\"column\": \"OPS_REGION\",\"derived\": null}],\"measures\": [{\"name\": \"GMV_SUM\",\"function\": {\"expression\": \"SUM\",\"parameter\": {\"type\": \"column\",\"value\": \"KYLIN_SALES.PRICE\"},\"returntype\": \"decimal(19,4)\"}},{\"name\": \"BUYER_LEVEL_SUM\",\"function\": {\"expression\": \"SUM\",\"parameter\": {\"type\": \"column\",\"value\": \"BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL\"},\"returntype\": \"bigint\"}},{\"name\": \"SELLER_LEVEL_SUM\",\"function\": {\"expression\": \"SUM\",\"parameter\": {\"type\": \"column\",\"value\": \"SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL\"},\"returntype\": \"bigint\"}},{\"name\": \"TRANS_CNT\",\"function\": {\"expression\": \"COUNT\",\"parameter\": {\"type\": \"constant\",\"value\": \"1\"},\"returntype\": \"bigint\"}},{\"name\": \"SELLER_CNT_HLL\",\"function\": {\"expression\": \"COUNT_DISTINCT\",\"parameter\": {\"type\": \"column\",\"value\": \"KYLIN_SALES.SELLER_ID\"},\"returntype\": \"hllc(10)\"}},{\"name\": \"TOP_SELLER\",\"function\": {\"expression\": \"TOP_N\",\"parameter\": {\"type\": \"column\",\"value\": \"KYLIN_SALES.PRICE\",\"next_parameter\": {\"type\": \"column\",\"value\": \"KYLIN_SALES.SELLER_ID\"}},\"returntype\": \"topn(100)\",\"configuration\": {\"topn.encoding.KYLIN_SALES.SELLER_ID\": \"dict\",\"topn.encoding_version.KYLIN_SALES.SELLER_ID\": \"1\"}}}],\"rowkey\": {\"rowkey_columns\": [{\"column\": \"KYLIN_SALES.BUYER_ID\",\"encoding\": \"integer:4\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_SALES.SELLER_ID\",\"encoding\": \"integer:4\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_SALES.TRANS_ID\",\"encoding\": \"integer:4\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_SALES.PART_DT\",\"encoding\": \"date\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_SALES.LEAF_CATEG_ID\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_CATEGORY_GROUPINGS.META_CATEG_NAME\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_CATEGORY_GROUPINGS.CATEG_LVL2_NAME\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_CATEGORY_GROUPINGS.CATEG_LVL3_NAME\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"BUYER_ACCOUNT.ACCOUNT_COUNTRY\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"SELLER_ACCOUNT.ACCOUNT_COUNTRY\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"BUYER_COUNTRY.NAME\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"SELLER_COUNTRY.NAME\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_SALES.LSTG_FORMAT_NAME\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_SALES.LSTG_SITE_ID\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_SALES.OPS_USER_ID\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false},{\"column\": \"KYLIN_SALES.OPS_REGION\",\"encoding\": \"dict\",\"encoding_version\": 1,\"isShardBy\": false}]},\"hbase_mapping\": {\"column_family\": [{\"name\": \"F1\",\"columns\": [{\"qualifier\": \"M\",\"measure_refs\": [\"GMV_SUM\",\"BUYER_LEVEL_SUM\",\"SELLER_LEVEL_SUM\",\"TRANS_CNT\"]}]},{\"name\": \"F2\",\"columns\": [{\"qualifier\": \"M\",\"measure_refs\": [\"SELLER_CNT_HLL\",\"TOP_SELLER\"]}]}]},\"aggregation_groups\": [{\"includes\": [\"KYLIN_SALES.PART_DT\",\"KYLIN_CATEGORY_GROUPINGS.META_CATEG_NAME\",\"KYLIN_CATEGORY_GROUPINGS.CATEG_LVL2_NAME\",\"KYLIN_CATEGORY_GROUPINGS.CATEG_LVL3_NAME\",\"KYLIN_SALES.LEAF_CATEG_ID\",\"KYLIN_SALES.LSTG_FORMAT_NAME\",\"KYLIN_SALES.LSTG_SITE_ID\",\"KYLIN_SALES.OPS_USER_ID\",\"KYLIN_SALES.OPS_REGION\",\"BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL\",\"SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL\",\"BUYER_ACCOUNT.ACCOUNT_COUNTRY\",\"SELLER_ACCOUNT.ACCOUNT_COUNTRY\",\"BUYER_COUNTRY.NAME\",\"SELLER_COUNTRY.NAME\"],\"select_rule\": {\"hierarchy_dims\": [[\"KYLIN_CATEGORY_GROUPINGS.META_CATEG_NAME\",\"KYLIN_CATEGORY_GROUPINGS.CATEG_LVL2_NAME\",\"KYLIN_CATEGORY_GROUPINGS.CATEG_LVL3_NAME\",\"KYLIN_SALES.LEAF_CATEG_ID\"]],\"mandatory_dims\": [\"KYLIN_SALES.PART_DT\"],\"joint_dims\": [[\"BUYER_ACCOUNT.ACCOUNT_COUNTRY\",\"BUYER_COUNTRY.NAME\"],[\"SELLER_ACCOUNT.ACCOUNT_COUNTRY\",\"SELLER_COUNTRY.NAME\"],[\"BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL\",\"SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL\"],[\"KYLIN_SALES.LSTG_FORMAT_NAME\",\"KYLIN_SALES.LSTG_SITE_ID\"],[\"KYLIN_SALES.OPS_USER_ID\",\"KYLIN_SALES.OPS_REGION\"]]}}],\"signature\": null,\"notify_list\": [],\"status_need_notify\": [],\"partition_date_start\": 1325376000000,\"partition_date_end\": 3153600000000,\"auto_merge_time_ranges\": [],\"volatile_range\": 0,\"retention_range\": 0,\"engine_type\": 2,\"storage_type\": 2,\"override_kylin_properties\": {\"kylin.cube.aggrgroup.is-mandatory-only-valid\": \"true\",\"kylin.engine.spark.rdd-partition-cut-mb\": \"500\"},\"cuboid_black_list\": [],\"parent_forward\": 3,\"mandatory_dimension_set_list\": [],\"snapshot_table_desc_list\": []}",
  5. "streamingData": null,
  6. "kafkaData": null,
  7. "successful": true,
  8. "message": null,
  9. "project": "learn_kylin",
  10. "streamingCube": null
  11. }

Update Cube

PUT /kylin/api/cubes

Request Body

(Same as “Create Cube”)

Request Sample

(Same as “Create Cube”)

Response Sample

(Same as “Create Cube”)

List cubes

GET /kylin/api/cubes

Request Parameters

  • offset - required int Offset used by pagination
  • limit - required int Cubes per page.
  • cubeName - optional string Keyword for cube names. To find cubes whose name contains this keyword.
  • projectName - optional string Project name.

Response Sample

  1. [
  2. {
  3. "uuid":"1eaca32a-a33e-4b69-83dd-0bb8b1f8c53b",
  4. "last_modified":1407831634847,
  5. "name":"test_kylin_cube_with_slr_empty",
  6. "owner":null,
  7. "version":null,
  8. "descriptor":"test_kylin_cube_with_slr_desc",
  9. "cost":50,
  10. "status":"DISABLED",
  11. "segments":[
  12. ],
  13. "create_time":null,
  14. "source_records_count":0,
  15. "source_records_size":0,
  16. "size_kb":0
  17. }
  18. ]

Get cube

GET /kylin/api/cubes/{cubeName}

Path Variable

  • cubeName - required string Cube name to find.

Get cube descriptor

GET /kylin/api/cube_desc/{cubeName}
Get descriptor for specified cube instance.

Path Variable

  • cubeName - required string Cube name.

Response Sample

  1. [
  2. {
  3. "uuid": "0ef9b7a8-3929-4dff-b59d-2100aadc8dbf",
  4. "last_modified": 1574402902000,
  5. "version": "3.0.0.20500",
  6. "name": "kylin_sales_cube",
  7. "is_draft": false,
  8. "model_name": "kylin_sales_model",
  9. "description": "",
  10. "null_string": null,
  11. "dimensions": [
  12. {
  13. "name": "TRANS_ID",
  14. "table": "KYLIN_SALES",
  15. "column": "TRANS_ID",
  16. "derived": null
  17. },
  18. {
  19. "name": "YEAR_BEG_DT",
  20. "table": "KYLIN_CAL_DT",
  21. "column": null,
  22. "derived": [
  23. "YEAR_BEG_DT"
  24. ]
  25. },
  26. {
  27. "name": "MONTH_BEG_DT",
  28. "table": "KYLIN_CAL_DT",
  29. "column": null,
  30. "derived": [
  31. "MONTH_BEG_DT"
  32. ]
  33. },
  34. {
  35. "name": "WEEK_BEG_DT",
  36. "table": "KYLIN_CAL_DT",
  37. "column": null,
  38. "derived": [
  39. "WEEK_BEG_DT"
  40. ]
  41. },
  42. {
  43. "name": "USER_DEFINED_FIELD1",
  44. "table": "KYLIN_CATEGORY_GROUPINGS",
  45. "column": null,
  46. "derived": [
  47. "USER_DEFINED_FIELD1"
  48. ]
  49. },
  50. {
  51. "name": "USER_DEFINED_FIELD3",
  52. "table": "KYLIN_CATEGORY_GROUPINGS",
  53. "column": null,
  54. "derived": [
  55. "USER_DEFINED_FIELD3"
  56. ]
  57. },
  58. {
  59. "name": "META_CATEG_NAME",
  60. "table": "KYLIN_CATEGORY_GROUPINGS",
  61. "column": "META_CATEG_NAME",
  62. "derived": null
  63. },
  64. {
  65. "name": "CATEG_LVL2_NAME",
  66. "table": "KYLIN_CATEGORY_GROUPINGS",
  67. "column": "CATEG_LVL2_NAME",
  68. "derived": null
  69. },
  70. {
  71. "name": "CATEG_LVL3_NAME",
  72. "table": "KYLIN_CATEGORY_GROUPINGS",
  73. "column": "CATEG_LVL3_NAME",
  74. "derived": null
  75. },
  76. {
  77. "name": "LSTG_FORMAT_NAME",
  78. "table": "KYLIN_SALES",
  79. "column": "LSTG_FORMAT_NAME",
  80. "derived": null
  81. },
  82. {
  83. "name": "SELLER_ID",
  84. "table": "KYLIN_SALES",
  85. "column": "SELLER_ID",
  86. "derived": null
  87. },
  88. {
  89. "name": "BUYER_ID",
  90. "table": "KYLIN_SALES",
  91. "column": "BUYER_ID",
  92. "derived": null
  93. },
  94. {
  95. "name": "ACCOUNT_BUYER_LEVEL",
  96. "table": "BUYER_ACCOUNT",
  97. "column": "ACCOUNT_BUYER_LEVEL",
  98. "derived": null
  99. },
  100. {
  101. "name": "ACCOUNT_SELLER_LEVEL",
  102. "table": "SELLER_ACCOUNT",
  103. "column": "ACCOUNT_SELLER_LEVEL",
  104. "derived": null
  105. },
  106. {
  107. "name": "BUYER_COUNTRY",
  108. "table": "BUYER_ACCOUNT",
  109. "column": "ACCOUNT_COUNTRY",
  110. "derived": null
  111. },
  112. {
  113. "name": "SELLER_COUNTRY",
  114. "table": "SELLER_ACCOUNT",
  115. "column": "ACCOUNT_COUNTRY",
  116. "derived": null
  117. },
  118. {
  119. "name": "BUYER_COUNTRY_NAME",
  120. "table": "BUYER_COUNTRY",
  121. "column": "NAME",
  122. "derived": null
  123. },
  124. {
  125. "name": "SELLER_COUNTRY_NAME",
  126. "table": "SELLER_COUNTRY",
  127. "column": "NAME",
  128. "derived": null
  129. },
  130. {
  131. "name": "OPS_USER_ID",
  132. "table": "KYLIN_SALES",
  133. "column": "OPS_USER_ID",
  134. "derived": null
  135. },
  136. {
  137. "name": "OPS_REGION",
  138. "table": "KYLIN_SALES",
  139. "column": "OPS_REGION",
  140. "derived": null
  141. }
  142. ],
  143. "measures": [
  144. {
  145. "name": "GMV_SUM",
  146. "function": {
  147. "expression": "SUM",
  148. "parameter": {
  149. "type": "column",
  150. "value": "KYLIN_SALES.PRICE"
  151. },
  152. "returntype": "decimal(19,4)"
  153. }
  154. },
  155. {
  156. "name": "BUYER_LEVEL_SUM",
  157. "function": {
  158. "expression": "SUM",
  159. "parameter": {
  160. "type": "column",
  161. "value": "BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL"
  162. },
  163. "returntype": "bigint"
  164. }
  165. },
  166. {
  167. "name": "SELLER_LEVEL_SUM",
  168. "function": {
  169. "expression": "SUM",
  170. "parameter": {
  171. "type": "column",
  172. "value": "SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL"
  173. },
  174. "returntype": "bigint"
  175. }
  176. },
  177. {
  178. "name": "TRANS_CNT",
  179. "function": {
  180. "expression": "COUNT",
  181. "parameter": {
  182. "type": "constant",
  183. "value": "1"
  184. },
  185. "returntype": "bigint"
  186. }
  187. },
  188. {
  189. "name": "SELLER_CNT_HLL",
  190. "function": {
  191. "expression": "COUNT_DISTINCT",
  192. "parameter": {
  193. "type": "column",
  194. "value": "KYLIN_SALES.SELLER_ID"
  195. },
  196. "returntype": "hllc(10)"
  197. }
  198. },
  199. {
  200. "name": "TOP_SELLER",
  201. "function": {
  202. "expression": "TOP_N",
  203. "parameter": {
  204. "type": "column",
  205. "value": "KYLIN_SALES.PRICE",
  206. "next_parameter": {
  207. "type": "column",
  208. "value": "KYLIN_SALES.SELLER_ID"
  209. }
  210. },
  211. "returntype": "topn(100)",
  212. "configuration": {
  213. "topn.encoding.KYLIN_SALES.SELLER_ID": "dict",
  214. "topn.encoding_version.KYLIN_SALES.SELLER_ID": "1"
  215. }
  216. }
  217. }
  218. ],
  219. "rowkey": {
  220. "rowkey_columns": [
  221. {
  222. "column": "KYLIN_SALES.BUYER_ID",
  223. "encoding": "integer:4",
  224. "encoding_version": 1,
  225. "isShardBy": false
  226. },
  227. {
  228. "column": "KYLIN_SALES.SELLER_ID",
  229. "encoding": "integer:4",
  230. "encoding_version": 1,
  231. "isShardBy": false
  232. },
  233. {
  234. "column": "KYLIN_SALES.TRANS_ID",
  235. "encoding": "integer:4",
  236. "encoding_version": 1,
  237. "isShardBy": false
  238. },
  239. {
  240. "column": "KYLIN_SALES.PART_DT",
  241. "encoding": "date",
  242. "encoding_version": 1,
  243. "isShardBy": false
  244. },
  245. {
  246. "column": "KYLIN_SALES.LEAF_CATEG_ID",
  247. "encoding": "dict",
  248. "encoding_version": 1,
  249. "isShardBy": false
  250. },
  251. {
  252. "column": "KYLIN_CATEGORY_GROUPINGS.META_CATEG_NAME",
  253. "encoding": "dict",
  254. "encoding_version": 1,
  255. "isShardBy": false
  256. },
  257. {
  258. "column": "KYLIN_CATEGORY_GROUPINGS.CATEG_LVL2_NAME",
  259. "encoding": "dict",
  260. "encoding_version": 1,
  261. "isShardBy": false
  262. },
  263. {
  264. "column": "KYLIN_CATEGORY_GROUPINGS.CATEG_LVL3_NAME",
  265. "encoding": "dict",
  266. "encoding_version": 1,
  267. "isShardBy": false
  268. },
  269. {
  270. "column": "BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL",
  271. "encoding": "dict",
  272. "encoding_version": 1,
  273. "isShardBy": false
  274. },
  275. {
  276. "column": "SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL",
  277. "encoding": "dict",
  278. "encoding_version": 1,
  279. "isShardBy": false
  280. },
  281. {
  282. "column": "BUYER_ACCOUNT.ACCOUNT_COUNTRY",
  283. "encoding": "dict",
  284. "encoding_version": 1,
  285. "isShardBy": false
  286. },
  287. {
  288. "column": "SELLER_ACCOUNT.ACCOUNT_COUNTRY",
  289. "encoding": "dict",
  290. "encoding_version": 1,
  291. "isShardBy": false
  292. },
  293. {
  294. "column": "BUYER_COUNTRY.NAME",
  295. "encoding": "dict",
  296. "encoding_version": 1,
  297. "isShardBy": false
  298. },
  299. {
  300. "column": "SELLER_COUNTRY.NAME",
  301. "encoding": "dict",
  302. "encoding_version": 1,
  303. "isShardBy": false
  304. },
  305. {
  306. "column": "KYLIN_SALES.LSTG_FORMAT_NAME",
  307. "encoding": "dict",
  308. "encoding_version": 1,
  309. "isShardBy": false
  310. },
  311. {
  312. "column": "KYLIN_SALES.LSTG_SITE_ID",
  313. "encoding": "dict",
  314. "encoding_version": 1,
  315. "isShardBy": false
  316. },
  317. {
  318. "column": "KYLIN_SALES.OPS_USER_ID",
  319. "encoding": "dict",
  320. "encoding_version": 1,
  321. "isShardBy": false
  322. },
  323. {
  324. "column": "KYLIN_SALES.OPS_REGION",
  325. "encoding": "dict",
  326. "encoding_version": 1,
  327. "isShardBy": false
  328. }
  329. ]
  330. },
  331. "hbase_mapping": {
  332. "column_family": [
  333. {
  334. "name": "F1",
  335. "columns": [
  336. {
  337. "qualifier": "M",
  338. "measure_refs": [
  339. "GMV_SUM",
  340. "BUYER_LEVEL_SUM",
  341. "SELLER_LEVEL_SUM",
  342. "TRANS_CNT"
  343. ]
  344. }
  345. ]
  346. },
  347. {
  348. "name": "F2",
  349. "columns": [
  350. {
  351. "qualifier": "M",
  352. "measure_refs": [
  353. "SELLER_CNT_HLL",
  354. "TOP_SELLER"
  355. ]
  356. }
  357. ]
  358. }
  359. ]
  360. },
  361. "aggregation_groups": [
  362. {
  363. "includes": [
  364. "KYLIN_SALES.PART_DT",
  365. "KYLIN_CATEGORY_GROUPINGS.META_CATEG_NAME",
  366. "KYLIN_CATEGORY_GROUPINGS.CATEG_LVL2_NAME",
  367. "KYLIN_CATEGORY_GROUPINGS.CATEG_LVL3_NAME",
  368. "KYLIN_SALES.LEAF_CATEG_ID",
  369. "KYLIN_SALES.LSTG_FORMAT_NAME",
  370. "KYLIN_SALES.LSTG_SITE_ID",
  371. "KYLIN_SALES.OPS_USER_ID",
  372. "KYLIN_SALES.OPS_REGION",
  373. "BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL",
  374. "SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL",
  375. "BUYER_ACCOUNT.ACCOUNT_COUNTRY",
  376. "SELLER_ACCOUNT.ACCOUNT_COUNTRY",
  377. "BUYER_COUNTRY.NAME",
  378. "SELLER_COUNTRY.NAME"
  379. ],
  380. "select_rule": {
  381. "hierarchy_dims": [
  382. [
  383. "KYLIN_CATEGORY_GROUPINGS.META_CATEG_NAME",
  384. "KYLIN_CATEGORY_GROUPINGS.CATEG_LVL2_NAME",
  385. "KYLIN_CATEGORY_GROUPINGS.CATEG_LVL3_NAME",
  386. "KYLIN_SALES.LEAF_CATEG_ID"
  387. ]
  388. ],
  389. "mandatory_dims": [
  390. "KYLIN_SALES.PART_DT"
  391. ],
  392. "joint_dims": [
  393. [
  394. "BUYER_ACCOUNT.ACCOUNT_COUNTRY",
  395. "BUYER_COUNTRY.NAME"
  396. ],
  397. [
  398. "SELLER_ACCOUNT.ACCOUNT_COUNTRY",
  399. "SELLER_COUNTRY.NAME"
  400. ],
  401. [
  402. "BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL",
  403. "SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL"
  404. ],
  405. [
  406. "KYLIN_SALES.LSTG_FORMAT_NAME",
  407. "KYLIN_SALES.LSTG_SITE_ID"
  408. ],
  409. [
  410. "KYLIN_SALES.OPS_USER_ID",
  411. "KYLIN_SALES.OPS_REGION"
  412. ]
  413. ]
  414. }
  415. }
  416. ],
  417. "signature": null,
  418. "notify_list": [],
  419. "status_need_notify": [],
  420. "partition_date_start": 1325376000000,
  421. "partition_date_end": 3153600000000,
  422. "auto_merge_time_ranges": [],
  423. "volatile_range": 0,
  424. "retention_range": 0,
  425. "engine_type": 2,
  426. "storage_type": 2,
  427. "override_kylin_properties": {
  428. "kylin.cube.aggrgroup.is-mandatory-only-valid": "true",
  429. "kylin.engine.spark.rdd-partition-cut-mb": "500"
  430. },
  431. "cuboid_black_list": [],
  432. "parent_forward": 3,
  433. "mandatory_dimension_set_list": [],
  434. "snapshot_table_desc_list": []
  435. }
  436. ]

Get data model

GET /kylin/api/model/{modelName}

Path Variable

  • modelName - required string Data model name, by default it should be the same with cube name.

Response Sample

  1. {
  2. "uuid": "ff527b94-f860-44c3-8452-93b17774c647",
  3. "name": "test_kylin_with_slr_model_desc",
  4. "lookups": [
  5. {
  6. "table": "EDW.TEST_CAL_DT",
  7. "join": {
  8. "type": "inner",
  9. "primary_key": [
  10. "CAL_DT"
  11. ],
  12. "foreign_key": [
  13. "CAL_DT"
  14. ]
  15. }
  16. },
  17. {
  18. "table": "DEFAULT.TEST_CATEGORY_GROUPINGS",
  19. "join": {
  20. "type": "inner",
  21. "primary_key": [
  22. "LEAF_CATEG_ID",
  23. "SITE_ID"
  24. ],
  25. "foreign_key": [
  26. "LEAF_CATEG_ID",
  27. "LSTG_SITE_ID"
  28. ]
  29. }
  30. }
  31. ],
  32. "capacity": "MEDIUM",
  33. "last_modified": 1442372116000,
  34. "fact_table": "DEFAULT.TEST_KYLIN_FACT",
  35. "filter_condition": null,
  36. "partition_desc": {
  37. "partition_date_column": "DEFAULT.TEST_KYLIN_FACT.CAL_DT",
  38. "partition_date_start": 0,
  39. "partition_date_format": "yyyy-MM-dd",
  40. "partition_type": "APPEND",
  41. "partition_condition_builder": "org.apache.kylin.metadata.model.PartitionDesc$DefaultPartitionConditionBuilder"
  42. }
  43. }

Build cube

PUT /kylin/api/cubes/{cubeName}/build

Path Variable

  • cubeName - required string Cube name.

Request Body

  • startTime - required long Start timestamp of data to build, e.g. 1388563200000 for 2014-1-1
  • endTime - required long End timestamp of data to build
  • buildType - required string Supported build type: ‘BUILD’, ‘MERGE’, ‘REFRESH’

Curl Example

  1. curl -X PUT -H "Authorization: Basic XXXXXXXXX" -H 'Content-Type: application/json' -d '{"startTime":'1423526400000', "endTime":'1423612800000', "buildType":"BUILD"}' http://<host>:<port>/kylin/api/cubes/{cubeName}/build

Response Sample

  1. {
  2. "uuid":"c143e0e4-ac5f-434d-acf3-46b0d15e3dc6",
  3. "last_modified":1407908916705,
  4. "name":"test_kylin_cube_with_slr_empty - 19700101000000_20140731160000 - BUILD - PDT 2014-08-12 22:48:36",
  5. "type":"BUILD",
  6. "duration":0,
  7. "related_cube":"test_kylin_cube_with_slr_empty",
  8. "related_segment":"19700101000000_20140731160000",
  9. "exec_start_time":0,
  10. "exec_end_time":0,
  11. "mr_waiting":0,
  12. "steps":[
  13. {
  14. "interruptCmd":null,
  15. "name":"Create Intermediate Flat Hive Table",
  16. "sequence_id":0,
  17. "exec_cmd":"hive -e \"DROP TABLE IF EXISTS kylin_intermediate_test_kylin_cube_with_slr_desc_19700101000000_20140731160000_c143e0e4_ac5f_434d_acf3_46b0d15e3dc6;\nCREATE EXTERNAL TABLE IF NOT EXISTS kylin_intermediate_test_kylin_cube_with_slr_desc_19700101000000_20140731160000_c143e0e4_ac5f_434d_acf3_46b0d15e3dc6\n(\nCAL_DT date\n,LEAF_CATEG_ID int\n,LSTG_SITE_ID int\n,META_CATEG_NAME string\n,CATEG_LVL2_NAME string\n,CATEG_LVL3_NAME string\n,LSTG_FORMAT_NAME string\n,SLR_SEGMENT_CD smallint\n,SELLER_ID bigint\n,PRICE decimal\n)\nROW FORMAT DELIMITED FIELDS TERMINATED BY '\\177'\nSTORED AS SEQUENCEFILE\nLOCATION '/tmp/kylin-c143e0e4-ac5f-434d-acf3-46b0d15e3dc6/kylin_intermediate_test_kylin_cube_with_slr_desc_19700101000000_20140731160000_c143e0e4_ac5f_434d_acf3_46b0d15e3dc6';\nSET mapreduce.job.split.metainfo.maxsize=-1;\nSET mapred.compress.map.output=true;\nSET mapred.map.output.compression.codec=com.hadoop.compression.lzo.LzoCodec;\nSET mapred.output.compress=true;\nSET mapred.output.compression.codec=com.hadoop.compression.lzo.LzoCodec;\nSET mapred.output.compression.type=BLOCK;\nSET mapreduce.job.max.split.locations=2000;\nSET hive.exec.compress.output=true;\nSET hive.auto.convert.join.noconditionaltask = true;\nSET hive.auto.convert.join.noconditionaltask.size = 300000000;\nINSERT OVERWRITE TABLE kylin_intermediate_test_kylin_cube_with_slr_desc_19700101000000_20140731160000_c143e0e4_ac5f_434d_acf3_46b0d15e3dc6\nSELECT\nTEST_KYLIN_FACT.CAL_DT\n,TEST_KYLIN_FACT.LEAF_CATEG_ID\n,TEST_KYLIN_FACT.LSTG_SITE_ID\n,TEST_CATEGORY_GROUPINGS.META_CATEG_NAME\n,TEST_CATEGORY_GROUPINGS.CATEG_LVL2_NAME\n,TEST_CATEGORY_GROUPINGS.CATEG_LVL3_NAME\n,TEST_KYLIN_FACT.LSTG_FORMAT_NAME\n,TEST_KYLIN_FACT.SLR_SEGMENT_CD\n,TEST_KYLIN_FACT.SELLER_ID\n,TEST_KYLIN_FACT.PRICE\nFROM TEST_KYLIN_FACT\nINNER JOIN TEST_CAL_DT\nON TEST_KYLIN_FACT.CAL_DT = TEST_CAL_DT.CAL_DT\nINNER JOIN TEST_CATEGORY_GROUPINGS\nON TEST_KYLIN_FACT.LEAF_CATEG_ID = TEST_CATEGORY_GROUPINGS.LEAF_CATEG_ID AND TEST_KYLIN_FACT.LSTG_SITE_ID = TEST_CATEGORY_GROUPINGS.SITE_ID\nINNER JOIN TEST_SITES\nON TEST_KYLIN_FACT.LSTG_SITE_ID = TEST_SITES.SITE_ID\nINNER JOIN TEST_SELLER_TYPE_DIM\nON TEST_KYLIN_FACT.SLR_SEGMENT_CD = TEST_SELLER_TYPE_DIM.SELLER_TYPE_CD\nWHERE (test_kylin_fact.cal_dt < '2014-07-31 16:00:00')\n;\n\"",
  18. "interrupt_cmd":null,
  19. "exec_start_time":0,
  20. "exec_end_time":0,
  21. "exec_wait_time":0,
  22. "step_status":"PENDING",
  23. "cmd_type":"SHELL_CMD_HADOOP",
  24. "info":null,
  25. "run_async":false
  26. },
  27. {
  28. "interruptCmd":null,
  29. "name":"Extract Fact Table Distinct Columns",
  30. "sequence_id":1,
  31. "exec_cmd":" -conf C:/kylin/Kylin/server/src/main/resources/hadoop_job_conf_medium.xml -cubename test_kylin_cube_with_slr_empty -input /tmp/kylin-c143e0e4-ac5f-434d-acf3-46b0d15e3dc6/kylin_intermediate_test_kylin_cube_with_slr_desc_19700101000000_20140731160000_c143e0e4_ac5f_434d_acf3_46b0d15e3dc6 -output /tmp/kylin-c143e0e4-ac5f-434d-acf3-46b0d15e3dc6/test_kylin_cube_with_slr_empty/fact_distinct_columns -jobname Kylin_Fact_Distinct_Columns_test_kylin_cube_with_slr_empty_Step_1",
  32. "interrupt_cmd":null,
  33. "exec_start_time":0,
  34. "exec_end_time":0,
  35. "exec_wait_time":0,
  36. "step_status":"PENDING",
  37. "cmd_type":"JAVA_CMD_HADOOP_FACTDISTINCT",
  38. "info":null,
  39. "run_async":true
  40. },
  41. {
  42. "interruptCmd":null,
  43. "name":"Load HFile to HBase Table",
  44. "sequence_id":12,
  45. "exec_cmd":" -input /tmp/kylin-c143e0e4-ac5f-434d-acf3-46b0d15e3dc6/test_kylin_cube_with_slr_empty/hfile/ -htablename KYLIN-CUBE-TEST_KYLIN_CUBE_WITH_SLR_EMPTY-19700101000000_20140731160000_11BB4326-5975-4358-804C-70D53642E03A -cubename test_kylin_cube_with_slr_empty",
  46. "interrupt_cmd":null,
  47. "exec_start_time":0,
  48. "exec_end_time":0,
  49. "exec_wait_time":0,
  50. "step_status":"PENDING",
  51. "cmd_type":"JAVA_CMD_HADOOP_NO_MR_BULKLOAD",
  52. "info":null,
  53. "run_async":false
  54. }
  55. ],
  56. "job_status":"PENDING",
  57. "progress":0.0
  58. }

Enable Cube

PUT /kylin/api/cubes/{cubeName}/enable

Path variable

  • cubeName - required string Cube name.

Response Sample

  1. {
  2. "uuid":"1eaca32a-a33e-4b69-83dd-0bb8b1f8c53b",
  3. "last_modified":1407909046305,
  4. "name":"test_kylin_cube_with_slr_ready",
  5. "owner":null,
  6. "version":null,
  7. "descriptor":"test_kylin_cube_with_slr_desc",
  8. "cost":50,
  9. "status":"ACTIVE",
  10. "segments":[
  11. {
  12. "name":"19700101000000_20140531160000",
  13. "storage_location_identifier":"KYLIN-CUBE-TEST_KYLIN_CUBE_WITH_SLR_READY-19700101000000_20140531160000_BF043D2D-9A4A-45E9-AA59-5A17D3F34A50",
  14. "date_range_start":0,
  15. "date_range_end":1401552000000,
  16. "status":"READY",
  17. "size_kb":4758,
  18. "source_records":6000,
  19. "source_records_size":620356,
  20. "last_build_time":1407832663227,
  21. "last_build_job_id":"2c7a2b63-b052-4a51-8b09-0c24b5792cda",
  22. "binary_signature":null,
  23. "dictionaries":{
  24. "TEST_CATEGORY_GROUPINGS/CATEG_LVL2_NAME":"/dict/TEST_CATEGORY_GROUPINGS/CATEG_LVL2_NAME/16d8185c-ee6b-4f8c-a919-756d9809f937.dict",
  25. "TEST_KYLIN_FACT/LSTG_SITE_ID":"/dict/TEST_SITES/SITE_ID/0bec6bb3-1b0d-469c-8289-b8c4ca5d5001.dict",
  26. "TEST_KYLIN_FACT/SLR_SEGMENT_CD":"/dict/TEST_SELLER_TYPE_DIM/SELLER_TYPE_CD/0c5d77ec-316b-47e0-ba9a-0616be890ad6.dict",
  27. "TEST_KYLIN_FACT/CAL_DT":"/dict/PREDEFINED/date(yyyy-mm-dd)/64ac4f82-f2af-476e-85b9-f0805001014e.dict",
  28. "TEST_CATEGORY_GROUPINGS/CATEG_LVL3_NAME":"/dict/TEST_CATEGORY_GROUPINGS/CATEG_LVL3_NAME/270fbfb0-281c-4602-8413-2970a7439c47.dict",
  29. "TEST_KYLIN_FACT/LEAF_CATEG_ID":"/dict/TEST_CATEGORY_GROUPINGS/LEAF_CATEG_ID/2602386c-debb-4968-8d2f-b52b8215e385.dict",
  30. "TEST_CATEGORY_GROUPINGS/META_CATEG_NAME":"/dict/TEST_CATEGORY_GROUPINGS/META_CATEG_NAME/0410d2c4-4686-40bc-ba14-170042a2de94.dict"
  31. },
  32. "snapshots":{
  33. "TEST_CAL_DT":"/table_snapshot/TEST_CAL_DT.csv/8f7cfc8a-020d-4019-b419-3c6deb0ffaa0.snapshot",
  34. "TEST_SELLER_TYPE_DIM":"/table_snapshot/TEST_SELLER_TYPE_DIM.csv/c60fd05e-ac94-4016-9255-96521b273b81.snapshot",
  35. "TEST_CATEGORY_GROUPINGS":"/table_snapshot/TEST_CATEGORY_GROUPINGS.csv/363f4a59-b725-4459-826d-3188bde6a971.snapshot",
  36. "TEST_SITES":"/table_snapshot/TEST_SITES.csv/78e0aecc-3ec6-4406-b86e-bac4b10ea63b.snapshot"
  37. }
  38. }
  39. ],
  40. "create_time":null,
  41. "source_records_count":6000,
  42. "source_records_size":0,
  43. "size_kb":4758
  44. }

Disable Cube

PUT /kylin/api/cubes/{cubeName}/disable

Path variable

  • cubeName - required string Cube name.

Response Sample

(Same as “Enable Cube”)

Purge Cube

PUT /kylin/api/cubes/{cubeName}/purge

Path variable

  • cubeName - required string Cube name.

Response Sample

(Same as “Enable Cube”)

Delete Segment

DELETE /kylin/api/cubes/{cubeName}/segs/{segmentName}

Auto-merge Segment

PUT /kylin/api/cubes/{cubeName}/automerge

Get sql of a cube

GET /kylin/api/cubes/{cubeName}/sql

Path variable

  • cubeName - required string Cube name.

Response Sample

  1. {
  2. "sql": "SELECT\n`KYLIN_SALES`.`TRANS_ID` as `KYLIN_SALES_TRANS_ID`\n,`KYLIN_SALES`.`PART_DT` as `KYLIN_SALES_PART_DT`\n,`KYLIN_CAL_DT`.`YEAR_BEG_DT` as `KYLIN_CAL_DT_YEAR_BEG_DT`\n,`KYLIN_CAL_DT`.`MONTH_BEG_DT` as `KYLIN_CAL_DT_MONTH_BEG_DT`\n,`KYLIN_CAL_DT`.`WEEK_BEG_DT` as `KYLIN_CAL_DT_WEEK_BEG_DT`\n,`KYLIN_SALES`.`LEAF_CATEG_ID` as `KYLIN_SALES_LEAF_CATEG_ID`\n,`KYLIN_SALES`.`LSTG_SITE_ID` as `KYLIN_SALES_LSTG_SITE_ID`\n,`KYLIN_CATEGORY_GROUPINGS`.`USER_DEFINED_FIELD1` as `KYLIN_CATEGORY_GROUPINGS_USER_DEFINED_FIELD1`\n,`KYLIN_CATEGORY_GROUPINGS`.`USER_DEFINED_FIELD3` as `KYLIN_CATEGORY_GROUPINGS_USER_DEFINED_FIELD3`\n,`KYLIN_CATEGORY_GROUPINGS`.`META_CATEG_NAME` as `KYLIN_CATEGORY_GROUPINGS_META_CATEG_NAME`\n,`KYLIN_CATEGORY_GROUPINGS`.`CATEG_LVL2_NAME` as `KYLIN_CATEGORY_GROUPINGS_CATEG_LVL2_NAME`\n,`KYLIN_CATEGORY_GROUPINGS`.`CATEG_LVL3_NAME` as `KYLIN_CATEGORY_GROUPINGS_CATEG_LVL3_NAME`\n,`KYLIN_SALES`.`LSTG_FORMAT_NAME` as `KYLIN_SALES_LSTG_FORMAT_NAME`\n,`KYLIN_SALES`.`SELLER_ID` as `KYLIN_SALES_SELLER_ID`\n,`KYLIN_SALES`.`BUYER_ID` as `KYLIN_SALES_BUYER_ID`\n,`BUYER_ACCOUNT`.`ACCOUNT_BUYER_LEVEL` as `BUYER_ACCOUNT_ACCOUNT_BUYER_LEVEL`\n,`SELLER_ACCOUNT`.`ACCOUNT_SELLER_LEVEL` as `SELLER_ACCOUNT_ACCOUNT_SELLER_LEVEL`\n,`BUYER_ACCOUNT`.`ACCOUNT_COUNTRY` as `BUYER_ACCOUNT_ACCOUNT_COUNTRY`\n,`SELLER_ACCOUNT`.`ACCOUNT_COUNTRY` as `SELLER_ACCOUNT_ACCOUNT_COUNTRY`\n,`BUYER_COUNTRY`.`NAME` as `BUYER_COUNTRY_NAME`\n,`SELLER_COUNTRY`.`NAME` as `SELLER_COUNTRY_NAME`\n,`KYLIN_SALES`.`OPS_USER_ID` as `KYLIN_SALES_OPS_USER_ID`\n,`KYLIN_SALES`.`OPS_REGION` as `KYLIN_SALES_OPS_REGION`\n,`KYLIN_CAL_DT`.`CAL_DT` as `KYLIN_CAL_DT_CAL_DT`\n,`KYLIN_CATEGORY_GROUPINGS`.`LEAF_CATEG_ID` as `KYLIN_CATEGORY_GROUPINGS_LEAF_CATEG_ID`\n,`KYLIN_CATEGORY_GROUPINGS`.`SITE_ID` as `KYLIN_CATEGORY_GROUPINGS_SITE_ID`\n,`BUYER_ACCOUNT`.`ACCOUNT_ID` as `BUYER_ACCOUNT_ACCOUNT_ID`\n,`SELLER_ACCOUNT`.`ACCOUNT_ID` as `SELLER_ACCOUNT_ACCOUNT_ID`\n,`BUYER_COUNTRY`.`COUNTRY` as `BUYER_COUNTRY_COUNTRY`\n,`SELLER_COUNTRY`.`COUNTRY` as `SELLER_COUNTRY_COUNTRY`\n,`KYLIN_SALES`.`PRICE` as `KYLIN_SALES_PRICE`\n FROM `DEFAULT`.`KYLIN_SALES` as `KYLIN_SALES`\nINNER JOIN `DEFAULT`.`KYLIN_CAL_DT` as `KYLIN_CAL_DT`\nON `KYLIN_SALES`.`PART_DT` = `KYLIN_CAL_DT`.`CAL_DT`\nINNER JOIN `DEFAULT`.`KYLIN_CATEGORY_GROUPINGS` as `KYLIN_CATEGORY_GROUPINGS`\nON `KYLIN_SALES`.`LEAF_CATEG_ID` = `KYLIN_CATEGORY_GROUPINGS`.`LEAF_CATEG_ID` AND `KYLIN_SALES`.`LSTG_SITE_ID` = `KYLIN_CATEGORY_GROUPINGS`.`SITE_ID`\nINNER JOIN `DEFAULT`.`KYLIN_ACCOUNT` as `BUYER_ACCOUNT`\nON `KYLIN_SALES`.`BUYER_ID` = `BUYER_ACCOUNT`.`ACCOUNT_ID`\nINNER JOIN `DEFAULT`.`KYLIN_ACCOUNT` as `SELLER_ACCOUNT`\nON `KYLIN_SALES`.`SELLER_ID` = `SELLER_ACCOUNT`.`ACCOUNT_ID`\nINNER JOIN `DEFAULT`.`KYLIN_COUNTRY` as `BUYER_COUNTRY`\nON `BUYER_ACCOUNT`.`ACCOUNT_COUNTRY` = `BUYER_COUNTRY`.`COUNTRY`\nINNER JOIN `DEFAULT`.`KYLIN_COUNTRY` as `SELLER_COUNTRY`\nON `SELLER_ACCOUNT`.`ACCOUNT_COUNTRY` = `SELLER_COUNTRY`.`COUNTRY`\nWHERE 1=1"
  3. }

Get sql of a cube segment

GET /kylin/api/cubes/{cubeName}/segs/{segmentName}/sql

Path variable

  • cubeName - required string Cube name.
  • segmentName - required string Segment name.

Response Sample

  1. {
  2. "sql": "SELECT\n`KYLIN_SALES`.`TRANS_ID` as `KYLIN_SALES_TRANS_ID`\n,`KYLIN_SALES`.`PART_DT` as `KYLIN_SALES_PART_DT`\n,`KYLIN_CAL_DT`.`YEAR_BEG_DT` as `KYLIN_CAL_DT_YEAR_BEG_DT`\n,`KYLIN_CAL_DT`.`MONTH_BEG_DT` as `KYLIN_CAL_DT_MONTH_BEG_DT`\n,`KYLIN_CAL_DT`.`WEEK_BEG_DT` as `KYLIN_CAL_DT_WEEK_BEG_DT`\n,`KYLIN_SALES`.`LEAF_CATEG_ID` as `KYLIN_SALES_LEAF_CATEG_ID`\n,`KYLIN_SALES`.`LSTG_SITE_ID` as `KYLIN_SALES_LSTG_SITE_ID`\n,`KYLIN_CATEGORY_GROUPINGS`.`USER_DEFINED_FIELD1` as `KYLIN_CATEGORY_GROUPINGS_USER_DEFINED_FIELD1`\n,`KYLIN_CATEGORY_GROUPINGS`.`USER_DEFINED_FIELD3` as `KYLIN_CATEGORY_GROUPINGS_USER_DEFINED_FIELD3`\n,`KYLIN_CATEGORY_GROUPINGS`.`META_CATEG_NAME` as `KYLIN_CATEGORY_GROUPINGS_META_CATEG_NAME`\n,`KYLIN_CATEGORY_GROUPINGS`.`CATEG_LVL2_NAME` as `KYLIN_CATEGORY_GROUPINGS_CATEG_LVL2_NAME`\n,`KYLIN_CATEGORY_GROUPINGS`.`CATEG_LVL3_NAME` as `KYLIN_CATEGORY_GROUPINGS_CATEG_LVL3_NAME`\n,`KYLIN_SALES`.`LSTG_FORMAT_NAME` as `KYLIN_SALES_LSTG_FORMAT_NAME`\n,`KYLIN_SALES`.`SELLER_ID` as `KYLIN_SALES_SELLER_ID`\n,`KYLIN_SALES`.`BUYER_ID` as `KYLIN_SALES_BUYER_ID`\n,`BUYER_ACCOUNT`.`ACCOUNT_BUYER_LEVEL` as `BUYER_ACCOUNT_ACCOUNT_BUYER_LEVEL`\n,`SELLER_ACCOUNT`.`ACCOUNT_SELLER_LEVEL` as `SELLER_ACCOUNT_ACCOUNT_SELLER_LEVEL`\n,`BUYER_ACCOUNT`.`ACCOUNT_COUNTRY` as `BUYER_ACCOUNT_ACCOUNT_COUNTRY`\n,`SELLER_ACCOUNT`.`ACCOUNT_COUNTRY` as `SELLER_ACCOUNT_ACCOUNT_COUNTRY`\n,`BUYER_COUNTRY`.`NAME` as `BUYER_COUNTRY_NAME`\n,`SELLER_COUNTRY`.`NAME` as `SELLER_COUNTRY_NAME`\n,`KYLIN_SALES`.`OPS_USER_ID` as `KYLIN_SALES_OPS_USER_ID`\n,`KYLIN_SALES`.`OPS_REGION` as `KYLIN_SALES_OPS_REGION`\n,`KYLIN_CAL_DT`.`CAL_DT` as `KYLIN_CAL_DT_CAL_DT`\n,`KYLIN_CATEGORY_GROUPINGS`.`LEAF_CATEG_ID` as `KYLIN_CATEGORY_GROUPINGS_LEAF_CATEG_ID`\n,`KYLIN_CATEGORY_GROUPINGS`.`SITE_ID` as `KYLIN_CATEGORY_GROUPINGS_SITE_ID`\n,`BUYER_ACCOUNT`.`ACCOUNT_ID` as `BUYER_ACCOUNT_ACCOUNT_ID`\n,`SELLER_ACCOUNT`.`ACCOUNT_ID` as `SELLER_ACCOUNT_ACCOUNT_ID`\n,`BUYER_COUNTRY`.`COUNTRY` as `BUYER_COUNTRY_COUNTRY`\n,`SELLER_COUNTRY`.`COUNTRY` as `SELLER_COUNTRY_COUNTRY`\n,`KYLIN_SALES`.`PRICE` as `KYLIN_SALES_PRICE`\n FROM `DEFAULT`.`KYLIN_SALES` as `KYLIN_SALES`\nINNER JOIN `DEFAULT`.`KYLIN_CAL_DT` as `KYLIN_CAL_DT`\nON `KYLIN_SALES`.`PART_DT` = `KYLIN_CAL_DT`.`CAL_DT`\nINNER JOIN `DEFAULT`.`KYLIN_CATEGORY_GROUPINGS` as `KYLIN_CATEGORY_GROUPINGS`\nON `KYLIN_SALES`.`LEAF_CATEG_ID` = `KYLIN_CATEGORY_GROUPINGS`.`LEAF_CATEG_ID` AND `KYLIN_SALES`.`LSTG_SITE_ID` = `KYLIN_CATEGORY_GROUPINGS`.`SITE_ID`\nINNER JOIN `DEFAULT`.`KYLIN_ACCOUNT` as `BUYER_ACCOUNT`\nON `KYLIN_SALES`.`BUYER_ID` = `BUYER_ACCOUNT`.`ACCOUNT_ID`\nINNER JOIN `DEFAULT`.`KYLIN_ACCOUNT` as `SELLER_ACCOUNT`\nON `KYLIN_SALES`.`SELLER_ID` = `SELLER_ACCOUNT`.`ACCOUNT_ID`\nINNER JOIN `DEFAULT`.`KYLIN_COUNTRY` as `BUYER_COUNTRY`\nON `BUYER_ACCOUNT`.`ACCOUNT_COUNTRY` = `BUYER_COUNTRY`.`COUNTRY`\nINNER JOIN `DEFAULT`.`KYLIN_COUNTRY` as `SELLER_COUNTRY`\nON `SELLER_ACCOUNT`.`ACCOUNT_COUNTRY` = `SELLER_COUNTRY`.`COUNTRY`\nWHERE 1=1 AND (`KYLIN_SALES`.`PART_DT` >= '2012-01-01' AND `KYLIN_SALES`.`PART_DT` < '2012-01-03')\n"
  3. }

Force rebuild lookup table snapshot

PUT /kylin/api/cubes/{cubeName}/refresh_lookup

Clone cube

PUT /kylin/api/cubes/{cubeName}/clone

Delete cube

DELETE /kylin/api/cubes/{cubeName}

Get hbase info

GET /kylin/api/cubes/{cubeName}/hbase

Response Sample

  1. [
  2. {
  3. "segmentName": "20120101000000_20120103000000",
  4. "segmentUUID": null,
  5. "segmentStatus": "READY",
  6. "tableName": "KYLIN_E1VT22737D",
  7. "tableSize": 0,
  8. "regionCount": 1,
  9. "dateRangeStart": 1325376000000,
  10. "dateRangeEnd": 1325548800000,
  11. "sourceOffsetStart": 0,
  12. "sourceOffsetEnd": 0,
  13. "sourceCount": 29
  14. }
  15. ]

Get current cuboid

GET /kylin/api/cubes/{cubeName}/cuboids/current

Migrate Cube

POST /kylin/api/cubes/{cube}/{project}/migrate


Create Model

POST /kylin/api/models

Request Body

  • modelDescData - required string modelDescData to create
  • modelName - required string modelName to create
  • projectName - required string projectName to which model belongs

Request Sample

  1. {
  2. "modelDescData": "{\"uuid\": \"0928468a-9fab-4185-9a14-6f2e7c74823f\",\"last_modified\": 0,\"version\": \"3.0.0.20500\",\"name\": \"kylin_test_model\",\"owner\": null,\"is_draft\": false,\"description\": \"\",\"fact_table\": \"DEFAULT.KYLIN_SALES\",\"lookups\": [{\"table\": \"DEFAULT.KYLIN_CAL_DT\",\"kind\": \"LOOKUP\",\"alias\": \"KYLIN_CAL_DT\",\"join\": {\"type\": \"inner\",\"primary_key\": [\"KYLIN_CAL_DT.CAL_DT\"],\"foreign_key\": [\"KYLIN_SALES.PART_DT\"]}},{\"table\": \"DEFAULT.KYLIN_CATEGORY_GROUPINGS\",\"kind\": \"LOOKUP\",\"alias\": \"KYLIN_CATEGORY_GROUPINGS\",\"join\": {\"type\": \"inner\",\"primary_key\": [\"KYLIN_CATEGORY_GROUPINGS.LEAF_CATEG_ID\",\"KYLIN_CATEGORY_GROUPINGS.SITE_ID\"],\"foreign_key\": [\"KYLIN_SALES.LEAF_CATEG_ID\",\"KYLIN_SALES.LSTG_SITE_ID\"]}},{\"table\": \"DEFAULT.KYLIN_ACCOUNT\",\"kind\": \"LOOKUP\",\"alias\": \"BUYER_ACCOUNT\",\"join\": {\"type\": \"inner\",\"primary_key\": [\"BUYER_ACCOUNT.ACCOUNT_ID\"],\"foreign_key\": [\"KYLIN_SALES.BUYER_ID\"]}},{\"table\": \"DEFAULT.KYLIN_ACCOUNT\",\"kind\": \"LOOKUP\",\"alias\": \"SELLER_ACCOUNT\",\"join\": {\"type\": \"inner\",\"primary_key\": [\"SELLER_ACCOUNT.ACCOUNT_ID\"],\"foreign_key\": [\"KYLIN_SALES.SELLER_ID\"]}},{\"table\": \"DEFAULT.KYLIN_COUNTRY\",\"kind\": \"LOOKUP\",\"alias\": \"BUYER_COUNTRY\",\"join\": {\"type\": \"inner\",\"primary_key\": [\"BUYER_COUNTRY.COUNTRY\"],\"foreign_key\": [\"BUYER_ACCOUNT.ACCOUNT_COUNTRY\"]}},{\"table\": \"DEFAULT.KYLIN_COUNTRY\",\"kind\": \"LOOKUP\",\"alias\": \"SELLER_COUNTRY\",\"join\": {\"type\": \"inner\",\"primary_key\": [\"SELLER_COUNTRY.COUNTRY\"],\"foreign_key\": [\"SELLER_ACCOUNT.ACCOUNT_COUNTRY\"]}}],\"dimensions\": [{\"table\": \"KYLIN_SALES\",\"columns\": [\"TRANS_ID\",\"SELLER_ID\",\"BUYER_ID\",\"PART_DT\",\"LEAF_CATEG_ID\",\"LSTG_FORMAT_NAME\",\"LSTG_SITE_ID\",\"OPS_USER_ID\",\"OPS_REGION\"]},{\"table\": \"KYLIN_CAL_DT\",\"columns\": [\"CAL_DT\",\"WEEK_BEG_DT\",\"MONTH_BEG_DT\",\"YEAR_BEG_DT\"]},{\"table\": \"KYLIN_CATEGORY_GROUPINGS\",\"columns\": [\"USER_DEFINED_FIELD1\",\"USER_DEFINED_FIELD3\",\"META_CATEG_NAME\",\"CATEG_LVL2_NAME\",\"CATEG_LVL3_NAME\",\"LEAF_CATEG_ID\",\"SITE_ID\"]},{\"table\": \"BUYER_ACCOUNT\",\"columns\": [\"ACCOUNT_ID\",\"ACCOUNT_BUYER_LEVEL\",\"ACCOUNT_SELLER_LEVEL\",\"ACCOUNT_COUNTRY\",\"ACCOUNT_CONTACT\"]},{\"table\": \"SELLER_ACCOUNT\",\"columns\": [\"ACCOUNT_ID\",\"ACCOUNT_BUYER_LEVEL\",\"ACCOUNT_SELLER_LEVEL\",\"ACCOUNT_COUNTRY\",\"ACCOUNT_CONTACT\"]},{\"table\": \"BUYER_COUNTRY\",\"columns\": [\"COUNTRY\",\"NAME\"]},{\"table\": \"SELLER_COUNTRY\",\"columns\": [\"COUNTRY\",\"NAME\"]}],\"metrics\": [\"KYLIN_SALES.PRICE\",\"KYLIN_SALES.ITEM_COUNT\"],\"filter_condition\": \"\",\"partition_desc\": {\"partition_date_column\": \"KYLIN_SALES.PART_DT\",\"partition_time_column\": null,\"partition_date_start\": 1325376000000,\"partition_date_format\": \"yyyy-MM-dd\",\"partition_time_format\": \"HH:mm:ss\",\"partition_type\": \"APPEND\",\"partition_condition_builder\": \"org.apache.kylin.metadata.model.PartitionDesc$DefaultPartitionConditionBuilder\"},\"capacity\": \"MEDIUM\"}",
  3. "modelName": "kylin_test_model",
  4. "project": "learn_kylin"
  5. }

Response Sample

  1. {
  2. "uuid": "2613d739-14c1-38ac-2e37-f36e46fd9976",
  3. "modelName": "kylin_test_model",
  4. "modelDescData": "{\"uuid\": \"0928468a-9fab-4185-9a14-6f2e7c74823f\",\"last_modified\": 0,\"version\": \"3.0.0.20500\",\"name\": \"kylin_test_model\",\"owner\": null,\"is_draft\": false,\"description\": \"\",\"fact_table\": \"DEFAULT.KYLIN_SALES\",\"lookups\": [{\"table\": \"DEFAULT.KYLIN_CAL_DT\",\"kind\": \"LOOKUP\",\"alias\": \"KYLIN_CAL_DT\",\"join\": {\"type\": \"inner\",\"primary_key\": [\"KYLIN_CAL_DT.CAL_DT\"],\"foreign_key\": [\"KYLIN_SALES.PART_DT\"]}},{\"table\": \"DEFAULT.KYLIN_CATEGORY_GROUPINGS\",\"kind\": \"LOOKUP\",\"alias\": \"KYLIN_CATEGORY_GROUPINGS\",\"join\": {\"type\": \"inner\",\"primary_key\": [\"KYLIN_CATEGORY_GROUPINGS.LEAF_CATEG_ID\",\"KYLIN_CATEGORY_GROUPINGS.SITE_ID\"],\"foreign_key\": [\"KYLIN_SALES.LEAF_CATEG_ID\",\"KYLIN_SALES.LSTG_SITE_ID\"]}},{\"table\": \"DEFAULT.KYLIN_ACCOUNT\",\"kind\": \"LOOKUP\",\"alias\": \"BUYER_ACCOUNT\",\"join\": {\"type\": \"inner\",\"primary_key\": [\"BUYER_ACCOUNT.ACCOUNT_ID\"],\"foreign_key\": [\"KYLIN_SALES.BUYER_ID\"]}},{\"table\": \"DEFAULT.KYLIN_ACCOUNT\",\"kind\": \"LOOKUP\",\"alias\": \"SELLER_ACCOUNT\",\"join\": {\"type\": \"inner\",\"primary_key\": [\"SELLER_ACCOUNT.ACCOUNT_ID\"],\"foreign_key\": [\"KYLIN_SALES.SELLER_ID\"]}},{\"table\": \"DEFAULT.KYLIN_COUNTRY\",\"kind\": \"LOOKUP\",\"alias\": \"BUYER_COUNTRY\",\"join\": {\"type\": \"inner\",\"primary_key\": [\"BUYER_COUNTRY.COUNTRY\"],\"foreign_key\": [\"BUYER_ACCOUNT.ACCOUNT_COUNTRY\"]}},{\"table\": \"DEFAULT.KYLIN_COUNTRY\",\"kind\": \"LOOKUP\",\"alias\": \"SELLER_COUNTRY\",\"join\": {\"type\": \"inner\",\"primary_key\": [\"SELLER_COUNTRY.COUNTRY\"],\"foreign_key\": [\"SELLER_ACCOUNT.ACCOUNT_COUNTRY\"]}}],\"dimensions\": [{\"table\": \"KYLIN_SALES\",\"columns\": [\"TRANS_ID\",\"SELLER_ID\",\"BUYER_ID\",\"PART_DT\",\"LEAF_CATEG_ID\",\"LSTG_FORMAT_NAME\",\"LSTG_SITE_ID\",\"OPS_USER_ID\",\"OPS_REGION\"]},{\"table\": \"KYLIN_CAL_DT\",\"columns\": [\"CAL_DT\",\"WEEK_BEG_DT\",\"MONTH_BEG_DT\",\"YEAR_BEG_DT\"]},{\"table\": \"KYLIN_CATEGORY_GROUPINGS\",\"columns\": [\"USER_DEFINED_FIELD1\",\"USER_DEFINED_FIELD3\",\"META_CATEG_NAME\",\"CATEG_LVL2_NAME\",\"CATEG_LVL3_NAME\",\"LEAF_CATEG_ID\",\"SITE_ID\"]},{\"table\": \"BUYER_ACCOUNT\",\"columns\": [\"ACCOUNT_ID\",\"ACCOUNT_BUYER_LEVEL\",\"ACCOUNT_SELLER_LEVEL\",\"ACCOUNT_COUNTRY\",\"ACCOUNT_CONTACT\"]},{\"table\": \"SELLER_ACCOUNT\",\"columns\": [\"ACCOUNT_ID\",\"ACCOUNT_BUYER_LEVEL\",\"ACCOUNT_SELLER_LEVEL\",\"ACCOUNT_COUNTRY\",\"ACCOUNT_CONTACT\"]},{\"table\": \"BUYER_COUNTRY\",\"columns\": [\"COUNTRY\",\"NAME\"]},{\"table\": \"SELLER_COUNTRY\",\"columns\": [\"COUNTRY\",\"NAME\"]}],\"metrics\": [\"KYLIN_SALES.PRICE\",\"KYLIN_SALES.ITEM_COUNT\"],\"filter_condition\": \"\",\"partition_desc\": {\"partition_date_column\": \"KYLIN_SALES.PART_DT\",\"partition_time_column\": null,\"partition_date_start\": 1325376000000,\"partition_date_format\": \"yyyy-MM-dd\",\"partition_time_format\": \"HH:mm:ss\",\"partition_type\": \"APPEND\",\"partition_condition_builder\": \"org.apache.kylin.metadata.model.PartitionDesc$DefaultPartitionConditionBuilder\"},\"capacity\": \"MEDIUM\"}",
  5. "successful": true,
  6. "message": null,
  7. "project": "learn_kylin",
  8. "ccInCheck": null,
  9. "seekingExprAdvice": false
  10. }

Update Model

PUT /kylin/api/models

Request Body

(Same as “Create Model”)

Request Sample

(Same as “Create Model”)

Response Sample

(Same as “Create Model”)

Get ModelDescData

GET /kylin/api/models

Request Parameters

  • modelName - optional string Model name.
  • projectName - optional string Project Name.
  • limit - optional integer Offset used by pagination
  • offset - optional integer Models per page

Response Sample

  1. [
  2. {
  3. "uuid": "0928468a-9fab-4185-9a14-6f2e7c74823f",
  4. "last_modified": 1568862496000,
  5. "version": "3.0.0.20500",
  6. "name": "kylin_sales_model",
  7. "owner": null,
  8. "is_draft": false,
  9. "description": "",
  10. "fact_table": "DEFAULT.KYLIN_SALES",
  11. "lookups": [
  12. {
  13. "table": "DEFAULT.KYLIN_CAL_DT",
  14. "kind": "LOOKUP",
  15. "alias": "KYLIN_CAL_DT",
  16. "join": {
  17. "type": "inner",
  18. "primary_key": [
  19. "KYLIN_CAL_DT.CAL_DT"
  20. ],
  21. "foreign_key": [
  22. "KYLIN_SALES.PART_DT"
  23. ]
  24. }
  25. },
  26. {
  27. "table": "DEFAULT.KYLIN_CATEGORY_GROUPINGS",
  28. "kind": "LOOKUP",
  29. "alias": "KYLIN_CATEGORY_GROUPINGS",
  30. "join": {
  31. "type": "inner",
  32. "primary_key": [
  33. "KYLIN_CATEGORY_GROUPINGS.LEAF_CATEG_ID",
  34. "KYLIN_CATEGORY_GROUPINGS.SITE_ID"
  35. ],
  36. "foreign_key": [
  37. "KYLIN_SALES.LEAF_CATEG_ID",
  38. "KYLIN_SALES.LSTG_SITE_ID"
  39. ]
  40. }
  41. },
  42. {
  43. "table": "DEFAULT.KYLIN_ACCOUNT",
  44. "kind": "LOOKUP",
  45. "alias": "BUYER_ACCOUNT",
  46. "join": {
  47. "type": "inner",
  48. "primary_key": [
  49. "BUYER_ACCOUNT.ACCOUNT_ID"
  50. ],
  51. "foreign_key": [
  52. "KYLIN_SALES.BUYER_ID"
  53. ]
  54. }
  55. },
  56. {
  57. "table": "DEFAULT.KYLIN_ACCOUNT",
  58. "kind": "LOOKUP",
  59. "alias": "SELLER_ACCOUNT",
  60. "join": {
  61. "type": "inner",
  62. "primary_key": [
  63. "SELLER_ACCOUNT.ACCOUNT_ID"
  64. ],
  65. "foreign_key": [
  66. "KYLIN_SALES.SELLER_ID"
  67. ]
  68. }
  69. },
  70. {
  71. "table": "DEFAULT.KYLIN_COUNTRY",
  72. "kind": "LOOKUP",
  73. "alias": "BUYER_COUNTRY",
  74. "join": {
  75. "type": "inner",
  76. "primary_key": [
  77. "BUYER_COUNTRY.COUNTRY"
  78. ],
  79. "foreign_key": [
  80. "BUYER_ACCOUNT.ACCOUNT_COUNTRY"
  81. ]
  82. }
  83. },
  84. {
  85. "table": "DEFAULT.KYLIN_COUNTRY",
  86. "kind": "LOOKUP",
  87. "alias": "SELLER_COUNTRY",
  88. "join": {
  89. "type": "inner",
  90. "primary_key": [
  91. "SELLER_COUNTRY.COUNTRY"
  92. ],
  93. "foreign_key": [
  94. "SELLER_ACCOUNT.ACCOUNT_COUNTRY"
  95. ]
  96. }
  97. }
  98. ],
  99. "dimensions": [
  100. {
  101. "table": "KYLIN_SALES",
  102. "columns": [
  103. "TRANS_ID",
  104. "SELLER_ID",
  105. "BUYER_ID",
  106. "PART_DT",
  107. "LEAF_CATEG_ID",
  108. "LSTG_FORMAT_NAME",
  109. "LSTG_SITE_ID",
  110. "OPS_USER_ID",
  111. "OPS_REGION"
  112. ]
  113. },
  114. {
  115. "table": "KYLIN_CAL_DT",
  116. "columns": [
  117. "CAL_DT",
  118. "WEEK_BEG_DT",
  119. "MONTH_BEG_DT",
  120. "YEAR_BEG_DT"
  121. ]
  122. },
  123. {
  124. "table": "KYLIN_CATEGORY_GROUPINGS",
  125. "columns": [
  126. "USER_DEFINED_FIELD1",
  127. "USER_DEFINED_FIELD3",
  128. "META_CATEG_NAME",
  129. "CATEG_LVL2_NAME",
  130. "CATEG_LVL3_NAME",
  131. "LEAF_CATEG_ID",
  132. "SITE_ID"
  133. ]
  134. },
  135. {
  136. "table": "BUYER_ACCOUNT",
  137. "columns": [
  138. "ACCOUNT_ID",
  139. "ACCOUNT_BUYER_LEVEL",
  140. "ACCOUNT_SELLER_LEVEL",
  141. "ACCOUNT_COUNTRY",
  142. "ACCOUNT_CONTACT"
  143. ]
  144. },
  145. {
  146. "table": "SELLER_ACCOUNT",
  147. "columns": [
  148. "ACCOUNT_ID",
  149. "ACCOUNT_BUYER_LEVEL",
  150. "ACCOUNT_SELLER_LEVEL",
  151. "ACCOUNT_COUNTRY",
  152. "ACCOUNT_CONTACT"
  153. ]
  154. },
  155. {
  156. "table": "BUYER_COUNTRY",
  157. "columns": [
  158. "COUNTRY",
  159. "NAME"
  160. ]
  161. },
  162. {
  163. "table": "SELLER_COUNTRY",
  164. "columns": [
  165. "COUNTRY",
  166. "NAME"
  167. ]
  168. }
  169. ],
  170. "metrics": [
  171. "KYLIN_SALES.PRICE",
  172. "KYLIN_SALES.ITEM_COUNT"
  173. ],
  174. "filter_condition": "",
  175. "partition_desc": {
  176. "partition_date_column": "KYLIN_SALES.PART_DT",
  177. "partition_time_column": null,
  178. "partition_date_start": 1325376000000,
  179. "partition_date_format": "yyyy-MM-dd",
  180. "partition_time_format": "HH:mm:ss",
  181. "partition_type": "APPEND",
  182. "partition_condition_builder": "org.apache.kylin.metadata.model.PartitionDesc$DefaultPartitionConditionBuilder"
  183. },
  184. "capacity": "MEDIUM"
  185. }
  186. ]

Delete Model

DELETE /kylin/api/models/{modelName}

Path variable

  • modelName - required string Model name.

Clone Model

PUT /kylin/api/models/{modelName}/clone


Resume Job

PUT /kylin/api/jobs/{jobId}/resume

Path variable

  • jobId - required string Job id.

Response Sample

  1. {
  2. "uuid":"c143e0e4-ac5f-434d-acf3-46b0d15e3dc6",
  3. "last_modified":1407908916705,
  4. "name":"test_kylin_cube_with_slr_empty - 19700101000000_20140731160000 - BUILD - PDT 2014-08-12 22:48:36",
  5. "type":"BUILD",
  6. "duration":0,
  7. "related_cube":"test_kylin_cube_with_slr_empty",
  8. "related_segment":"19700101000000_20140731160000",
  9. "exec_start_time":0,
  10. "exec_end_time":0,
  11. "mr_waiting":0,
  12. "steps":[
  13. {
  14. "interruptCmd":null,
  15. "name":"Create Intermediate Flat Hive Table",
  16. "sequence_id":0,
  17. "exec_cmd":"hive -e \"DROP TABLE IF EXISTS kylin_intermediate_test_kylin_cube_with_slr_desc_19700101000000_20140731160000_c143e0e4_ac5f_434d_acf3_46b0d15e3dc6;\nCREATE EXTERNAL TABLE IF NOT EXISTS kylin_intermediate_test_kylin_cube_with_slr_desc_19700101000000_20140731160000_c143e0e4_ac5f_434d_acf3_46b0d15e3dc6\n(\nCAL_DT date\n,LEAF_CATEG_ID int\n,LSTG_SITE_ID int\n,META_CATEG_NAME string\n,CATEG_LVL2_NAME string\n,CATEG_LVL3_NAME string\n,LSTG_FORMAT_NAME string\n,SLR_SEGMENT_CD smallint\n,SELLER_ID bigint\n,PRICE decimal\n)\nROW FORMAT DELIMITED FIELDS TERMINATED BY '\\177'\nSTORED AS SEQUENCEFILE\nLOCATION '/tmp/kylin-c143e0e4-ac5f-434d-acf3-46b0d15e3dc6/kylin_intermediate_test_kylin_cube_with_slr_desc_19700101000000_20140731160000_c143e0e4_ac5f_434d_acf3_46b0d15e3dc6';\nSET mapreduce.job.split.metainfo.maxsize=-1;\nSET mapred.compress.map.output=true;\nSET mapred.map.output.compression.codec=com.hadoop.compression.lzo.LzoCodec;\nSET mapred.output.compress=true;\nSET mapred.output.compression.codec=com.hadoop.compression.lzo.LzoCodec;\nSET mapred.output.compression.type=BLOCK;\nSET mapreduce.job.max.split.locations=2000;\nSET hive.exec.compress.output=true;\nSET hive.auto.convert.join.noconditionaltask = true;\nSET hive.auto.convert.join.noconditionaltask.size = 300000000;\nINSERT OVERWRITE TABLE kylin_intermediate_test_kylin_cube_with_slr_desc_19700101000000_20140731160000_c143e0e4_ac5f_434d_acf3_46b0d15e3dc6\nSELECT\nTEST_KYLIN_FACT.CAL_DT\n,TEST_KYLIN_FACT.LEAF_CATEG_ID\n,TEST_KYLIN_FACT.LSTG_SITE_ID\n,TEST_CATEGORY_GROUPINGS.META_CATEG_NAME\n,TEST_CATEGORY_GROUPINGS.CATEG_LVL2_NAME\n,TEST_CATEGORY_GROUPINGS.CATEG_LVL3_NAME\n,TEST_KYLIN_FACT.LSTG_FORMAT_NAME\n,TEST_KYLIN_FACT.SLR_SEGMENT_CD\n,TEST_KYLIN_FACT.SELLER_ID\n,TEST_KYLIN_FACT.PRICE\nFROM TEST_KYLIN_FACT\nINNER JOIN TEST_CAL_DT\nON TEST_KYLIN_FACT.CAL_DT = TEST_CAL_DT.CAL_DT\nINNER JOIN TEST_CATEGORY_GROUPINGS\nON TEST_KYLIN_FACT.LEAF_CATEG_ID = TEST_CATEGORY_GROUPINGS.LEAF_CATEG_ID AND TEST_KYLIN_FACT.LSTG_SITE_ID = TEST_CATEGORY_GROUPINGS.SITE_ID\nINNER JOIN TEST_SITES\nON TEST_KYLIN_FACT.LSTG_SITE_ID = TEST_SITES.SITE_ID\nINNER JOIN TEST_SELLER_TYPE_DIM\nON TEST_KYLIN_FACT.SLR_SEGMENT_CD = TEST_SELLER_TYPE_DIM.SELLER_TYPE_CD\nWHERE (test_kylin_fact.cal_dt < '2014-07-31 16:00:00')\n;\n\"",
  18. "interrupt_cmd":null,
  19. "exec_start_time":0,
  20. "exec_end_time":0,
  21. "exec_wait_time":0,
  22. "step_status":"PENDING",
  23. "cmd_type":"SHELL_CMD_HADOOP",
  24. "info":null,
  25. "run_async":false
  26. },
  27. {
  28. "interruptCmd":null,
  29. "name":"Extract Fact Table Distinct Columns",
  30. "sequence_id":1,
  31. "exec_cmd":" -conf C:/kylin/Kylin/server/src/main/resources/hadoop_job_conf_medium.xml -cubename test_kylin_cube_with_slr_empty -input /tmp/kylin-c143e0e4-ac5f-434d-acf3-46b0d15e3dc6/kylin_intermediate_test_kylin_cube_with_slr_desc_19700101000000_20140731160000_c143e0e4_ac5f_434d_acf3_46b0d15e3dc6 -output /tmp/kylin-c143e0e4-ac5f-434d-acf3-46b0d15e3dc6/test_kylin_cube_with_slr_empty/fact_distinct_columns -jobname Kylin_Fact_Distinct_Columns_test_kylin_cube_with_slr_empty_Step_1",
  32. "interrupt_cmd":null,
  33. "exec_start_time":0,
  34. "exec_end_time":0,
  35. "exec_wait_time":0,
  36. "step_status":"PENDING",
  37. "cmd_type":"JAVA_CMD_HADOOP_FACTDISTINCT",
  38. "info":null,
  39. "run_async":true
  40. },
  41. {
  42. "interruptCmd":null,
  43. "name":"Load HFile to HBase Table",
  44. "sequence_id":12,
  45. "exec_cmd":" -input /tmp/kylin-c143e0e4-ac5f-434d-acf3-46b0d15e3dc6/test_kylin_cube_with_slr_empty/hfile/ -htablename KYLIN-CUBE-TEST_KYLIN_CUBE_WITH_SLR_EMPTY-19700101000000_20140731160000_11BB4326-5975-4358-804C-70D53642E03A -cubename test_kylin_cube_with_slr_empty",
  46. "interrupt_cmd":null,
  47. "exec_start_time":0,
  48. "exec_end_time":0,
  49. "exec_wait_time":0,
  50. "step_status":"PENDING",
  51. "cmd_type":"JAVA_CMD_HADOOP_NO_MR_BULKLOAD",
  52. "info":null,
  53. "run_async":false
  54. }
  55. ],
  56. "job_status":"PENDING",
  57. "progress":0.0
  58. }

## Pause Job
PUT /kylin/api/jobs/{jobId}/pause

Path variable

  • jobId - required string Job id.

Discard Job

PUT /kylin/api/jobs/{jobId}/cancel

Path variable

  • jobId - required string Job id.

Drop Job

DELETE /kylin/api/jobs/{jobId}/drop

Path variable

  • jobId - required string Job id.

Get Job Status

GET /kylin/api/jobs/{jobId}

Path variable

  • jobId - required string Job id.

Response Sample

(Same as “Resume Job”)

Get job step output

GET /kylin/api/jobs/{jobId}/steps/{stepId}/output

Path Variable

  • jobId - required string Job id.
  • stepId - required string Step id; the step id is composed by jobId with step sequence id; for example, the jobId is “fb479e54-837f-49a2-b457-651fc50be110”, its 3rd step id is “fb479e54-837f-49a2-b457-651fc50be110-3”,

Response Sample

  1. {
  2. "cmd_output":"log string"
  3. }

Get job list

GET /kylin/api/jobs

Request Variables

  • cubeName - optional string Cube name.
  • projectName - required string Project name.
  • status - optional int Job status, e.g. (NEW: 0, PENDING: 1, RUNNING: 2, STOPPED: 32, FINISHED: 4, ERROR: 8, DISCARDED: 16)
  • offset - required int Offset used by pagination.
  • limit - required int Jobs per page.
  • timeFilter - required int, e.g. (LAST ONE DAY: 0, LAST ONE WEEK: 1, LAST ONE MONTH: 2, LAST ONE YEAR: 3, ALL: 4)

For example, to get the job list in project ‘learn_kylin’ for cube ‘kylin_sales_cube’ in lastone week:

  1. GET: /kylin/api/jobs?cubeName=kylin_sales_cube&limit=15&offset=0&projectName=learn_kylin&timeFilter=1

Response Sample

  1. [
  2. {
  3. "uuid": "9eb7bccf-4448-4578-9c29-552658b5a2ca",
  4. "last_modified": 1490957579843,
  5. "version": "2.0.0",
  6. "name": "Sample_Cube - 19700101000000_20150101000000 - BUILD - GMT+08:00 2017-03-31 18:36:08",
  7. "type": "BUILD",
  8. "duration": 936,
  9. "related_cube": "Sample_Cube",
  10. "related_segment": "53a5d7f7-7e06-4ea1-b3ee-b7f30343c723",
  11. "exec_start_time": 1490956581743,
  12. "exec_end_time": 1490957518131,
  13. "mr_waiting": 0,
  14. "steps": [
  15. {
  16. "interruptCmd": null,
  17. "id": "9eb7bccf-4448-4578-9c29-552658b5a2ca-00",
  18. "name": "Create Intermediate Flat Hive Table",
  19. "sequence_id": 0,
  20. "exec_cmd": null,
  21. "interrupt_cmd": null,
  22. "exec_start_time": 1490957508721,
  23. "exec_end_time": 1490957518102,
  24. "exec_wait_time": 0,
  25. "step_status": "DISCARDED",
  26. "cmd_type": "SHELL_CMD_HADOOP",
  27. "info": { "endTime": "1490957518102", "startTime": "1490957508721" },
  28. "run_async": false
  29. },
  30. {
  31. "interruptCmd": null,
  32. "id": "9eb7bccf-4448-4578-9c29-552658b5a2ca-01",
  33. "name": "Redistribute Flat Hive Table",
  34. "sequence_id": 1,
  35. "exec_cmd": null,
  36. "interrupt_cmd": null,
  37. "exec_start_time": 0,
  38. "exec_end_time": 0,
  39. "exec_wait_time": 0,
  40. "step_status": "DISCARDED",
  41. "cmd_type": "SHELL_CMD_HADOOP",
  42. "info": {},
  43. "run_async": false
  44. }
  45. ],
  46. "submitter": "ADMIN",
  47. "job_status": "FINISHED",
  48. "progress": 100.0
  49. }
  50. ]

Get Job Status Overview

GET /kylin/api/jobs/overview

Request Variables

(Same as “Get job list”)

Response Sample

  1. {
  2. "DISCARDED": 0,
  3. "NEW": 0,
  4. "STOPPED": 0,
  5. "PENDING": 0,
  6. "RUNNING": 0,
  7. "FINISHED": 1,
  8. "ERROR": 0
  9. }

Resubmit realtime build job

PUT /kylin/api/jobs/{jobId}/resubmit

Rollback job

PUT /kylin/api/{jobId}/steps/{stepId}/rollback

Path Parameters

  • jobId - required string job id you want to rollback
  • stepId - required string specify rollback step id, e.g.(Create Intermediate Flat Hive:1)

For example, rollback job to Create Intermediate Flat Hive:
PUT: kylin/api/jobs/4e84cb5e-a929-89c7-6240-768fa9835d89/steps/1/rollback

Response Sample

  1. {
  2. "uuid": "4e84cb5e-a929-89c7-6240-768fa9835d89",
  3. "last_modified": 1590054128311,
  4. "version": "3.0.0.20500",
  5. "name": "BUILD CUBE - kylin_sales_cube - 20120102000000_20120103000000 - CST 2020-05-21 17:38:59",
  6. "projectName": "learn_kylin",
  7. "type": "BUILD",
  8. "duration": 187,
  9. "related_cube": "kylin_sales_cube",
  10. "display_cube_name": "kylin_sales_cube",
  11. "related_segment": "fca98f62-cb3f-8b53-5bf1-94a85334560b",
  12. "exec_start_time": 1590053963522,
  13. "exec_end_time": 0,
  14. "exec_interrupt_time": 0,
  15. "mr_waiting": 39,
  16. "steps": [
  17. {
  18. "interruptCmd": null,
  19. "id": "4e84cb5e-a929-89c7-6240-768fa9835d89-00",
  20. "name": "Create Intermediate Flat Hive Table",
  21. "sequence_id": 0,
  22. "exec_cmd": null,
  23. "interrupt_cmd": null,
  24. "exec_start_time": 0,
  25. "exec_end_time": 0,
  26. "exec_wait_time": 0,
  27. "step_status": "PENDING",
  28. "cmd_type": "SHELL_CMD_HADOOP",
  29. "info": {},
  30. "run_async": false
  31. },
  32. ...
  33. ],
  34. "submitter": "ADMIN",
  35. "job_status": "RUNNING",
  36. "build_instance": "20984@host",
  37. "progress": 0.0
  38. }

Get Hive Table

GET /kylin/api/tables/{project}/{tableName}

Path Parameters

  • project - required string project name
  • tableName - required string table name to find.

Response Sample

  1. {
  2. uuid: "69cc92c0-fc42-4bb9-893f-bd1141c91dbe",
  3. name: "SAMPLE_07",
  4. columns: [{
  5. id: "1",
  6. name: "CODE",
  7. datatype: "string"
  8. }, {
  9. id: "2",
  10. name: "DESCRIPTION",
  11. datatype: "string"
  12. }, {
  13. id: "3",
  14. name: "TOTAL_EMP",
  15. datatype: "int"
  16. }, {
  17. id: "4",
  18. name: "SALARY",
  19. datatype: "int"
  20. }],
  21. database: "DEFAULT",
  22. last_modified: 1419330476755
  23. }

Get Hive Tables

GET /kylin/api/tables

Request Parameters

  • project- required string will list all tables in the project.
  • ext- optional boolean set true to get extend info of table.

Response Sample

  1. [
  2. {
  3. uuid: "53856c96-fe4d-459e-a9dc-c339b1bc3310",
  4. name: "SAMPLE_08",
  5. columns: [{
  6. id: "1",
  7. name: "CODE",
  8. datatype: "string"
  9. }, {
  10. id: "2",
  11. name: "DESCRIPTION",
  12. datatype: "string"
  13. }, {
  14. id: "3",
  15. name: "TOTAL_EMP",
  16. datatype: "int"
  17. }, {
  18. id: "4",
  19. name: "SALARY",
  20. datatype: "int"
  21. }],
  22. database: "DEFAULT",
  23. cardinality: {},
  24. last_modified: 0,
  25. exd: {
  26. minFileSize: "46069",
  27. totalNumberFiles: "1",
  28. location: "hdfs://sandbox.hortonworks.com:8020/apps/hive/warehouse/sample_08",
  29. lastAccessTime: "1398176495945",
  30. lastUpdateTime: "1398176495981",
  31. columns: "struct columns { string code, string description, i32 total_emp, i32 salary}",
  32. partitionColumns: "",
  33. EXD_STATUS: "true",
  34. maxFileSize: "46069",
  35. inputformat: "org.apache.hadoop.mapred.TextInputFormat",
  36. partitioned: "false",
  37. tableName: "sample_08",
  38. owner: "hue",
  39. totalFileSize: "46069",
  40. outputformat: "org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat"
  41. }
  42. }
  43. ]

Load Hive Tables

POST /kylin/api/tables/{tables}/{project}

Request Parameters

  • tables - required string table names you want to load from hive, separated with comma.
  • project - required String the project which the tables will be loaded into.

Request Body

  • calculate - optional boolean

Response Sample

  1. {
  2. "result.loaded": ["DEFAULT.SAMPLE_07"],
  3. "result.unloaded": ["sapmle_08"]
  4. }

Unload Hive Tables

DELETE /kylin/api/tables/{tables}/{project}

Path Parameters

  • tables - required string table names you want to unload, separated with comma.
  • project - required String the project which the tables belong to.

Response Sample

  1. {
  2. "result.unload.success": [
  3. "kylin_sales"
  4. ],
  5. "result.unload.fail": []
  6. }

Show databases in hive

GET /kylin/api/tables/hive

Show tables in a hive database

GET /kylin/api/tables/hive/{database}


Wipe cache

PUT /kylin/api/cache/{type}/{name}/{action}

Path variable

  • type - required string ‘METADATA’ or ‘CUBE’
  • name - required string Cache key, e.g the cube name.
  • action - required string ‘create’, ‘update’ or ‘drop’

Announce wipe cache

PUT /kylin/api/cache/announce/{type}/{name}/{action}

Path variable

(Same as “Wipe cache”)

Hot load kylin config

POST /kylin/api/cache/announce/config


Initiate cube start position

Set the stream cube’s start position to the current latest offsets; This can avoid building from the earlist position of Kafka topic (if you have set a long retension time);

PUT /kylin/api/cubes/{cubeName}/init_start_offsets

Path variable

  • cubeName - required string Cube name

Response Sample

  1. {
  2. "result": "success",
  3. "offsets": "{0=246059529, 1=253547684, 2=253023895, 3=172996803, 4=165503476, 5=173513896, 6=19200473, 7=26691891, 8=26699895, 9=26694021, 10=19204164, 11=26694597}"
  4. }

Build stream cube

PUT /kylin/api/cubes/{cubeName}/build2

This API is specific for stream cube’s building;

Path variable

  • cubeName - required string Cube name

Request Body

  • sourceOffsetStart - required long The start offset, 0 represents from previous position;
  • sourceOffsetEnd - required long The end offset, 9223372036854775807 represents to the end position of current stream data
  • buildType - required Build type, “BUILD”, “MERGE” or “REFRESH”

Request Sample

  1. {
  2. "sourceOffsetStart": 0,
  3. "sourceOffsetEnd": 9223372036854775807,
  4. "buildType": "BUILD"
  5. }

Response Sample

  1. {
  2. "uuid": "3afd6e75-f921-41e1-8c68-cb60bc72a601",
  3. "last_modified": 1480402541240,
  4. "version": "1.6.0",
  5. "name": "embedded_cube_clone - 1409830324_1409849348 - BUILD - PST 2016-11-28 22:55:41",
  6. "type": "BUILD",
  7. "duration": 0,
  8. "related_cube": "embedded_cube_clone",
  9. "related_segment": "42ebcdea-cbe9-4905-84db-31cb25f11515",
  10. "exec_start_time": 0,
  11. "exec_end_time": 0,
  12. "mr_waiting": 0,
  13. ...
  14. }

Check segment holes

GET /kylin/api/cubes/{cubeName}/holes

Path variable

  • cubeName - required string Cube name

Fill segment holes

PUT /kylin/api/cubes/{cubeName}/holes

Path variable

  • cubeName - required string Cube name

Get streaming configs

GET /kylin/api/streaming/getConfig

Response sample

  1. [
  2. {
  3. "uuid": "8b2b9dfe-777c-4d39-bf89-8472ec929193",
  4. "last_modified": 1587528491000,
  5. "version": "3.0.0.20500",
  6. "name": "DEFAULT.KYLIN_STREAMING_TABLE",
  7. "type": "kafka"
  8. }
  9. ]

Get kafka configs

GET /kylin/api/streaming/getKfkConfig

Response sample

  1. [
  2. {
  3. "uuid": "8b2b9dfe-777c-4d39-bf89-8472ec919193",
  4. "last_modified": 1587528491000,
  5. "version": "3.0.0.20500",
  6. "name": "DEFAULT.KYLIN_STREAMING_TABLE",
  7. "clusters": [
  8. {
  9. "uuid": null,
  10. "last_modified": 0,
  11. "version": "3.0.0.20500",
  12. "brokers": [
  13. {
  14. "id": 0,
  15. "host": "localhost",
  16. "port": 9092
  17. }
  18. ]
  19. }
  20. ],
  21. "topic": "kylin_streaming_topic",
  22. "timeout": 60000,
  23. "parserName": "org.apache.kylin.source.kafka.TimedJsonStreamParser",
  24. "timestampField": "order_time",
  25. "margin": 0,
  26. "splitRows": 1000000,
  27. "parserProperties": null
  28. }
  29. ]

Create streaming schema

POST /kylin/api/streaming

Request body

  • project - required string Project which you want create streaming schema to.
  • tableData - required string Streaming table desc.
  • streamingConfig - required string Streaming config.
  • kafkaConfig - required string Kafka config.

Request sample

  1. {
  2. "project":"test",
  3. "tableData":"{\"uuid\": \"e286e39e-41d7-44c2-8fa2-41b365123987\",\"last_modified\": 0,\"version\": \"3.0.0.20500\",\"name\": \"KYLIN_TEST_STREAMING_TABLE\",\"columns\": [{\"id\": \"1\",\"name\": \"AMOUNT\",\"datatype\": \"decimal(19,4)\"},{\"id\": 3,\"name\": \"ORDER_TIME\",\"datatype\": \"timestamp\",\"index\": \"T\"}],\"source_type\": 1,\"table_type\": null,\"database\": \"DEFAULT\"}",
  4. "streamingConfig":"{\"uuid\": \"8b2b9dfe-777c-4d39-bf89-8472ec929193\",\"last_modified\": 0,\"version\": \"3.0.0.20500\",\"name\": \"DEFAULT.KYLIN_TEST_STREAMING_TABLE\",\"type\": \"kafka\"}",
  5. "kafkaConfig":"{\"uuid\": \"8b2b9dfe-777c-4d39-bf89-8472ec919193\",\"last_modified\": 0,\"version\": \"3.0.0.20500\",\"name\": \"DEFAULT.KYLIN_STREAMING_TABLE\",\"clusters\": [{\"uuid\": null,\"last_modified\": 0,\"version\": \"3.0.0.20500\",\"brokers\": [{\"id\": 0,\"host\": \"localhost\",\"port\": 9092}]}],\"topic\": \"kylin_streaming_topic\",\"timeout\": 60000,\"parserName\": \"org.apache.kylin.source.kafka.TimedJsonStreamParser\",\"timestampField\": \"order_time\",\"margin\": 0,\"splitRows\": 1000000,\"parserProperties\": null}"
  6. }

Response sample

  1. {
  2. "project": "test",
  3. "tableData": "{\"uuid\": \"e286e39e-41d7-44c2-8fa2-41b365123987\",\"last_modified\": 0,\"version\": \"3.0.0.20500\",\"name\": \"KYLIN_TEST_STREAMING_TABLE\",\"columns\": [{\"id\": \"1\",\"name\": \"AMOUNT\",\"datatype\": \"decimal(19,4)\"},{\"id\": 3,\"name\": \"ORDER_TIME\",\"datatype\": \"timestamp\",\"index\": \"T\"}],\"source_type\": 1,\"table_type\": null,\"database\": \"DEFAULT\"}",
  4. "streamingConfig": "{\"uuid\": \"8b2b9dfe-777c-4d39-bf89-8472ec929193\",\"last_modified\": 0,\"version\": \"3.0.0.20500\",\"name\": \"DEFAULT.KYLIN_TEST_STREAMING_TABLE\",\"type\": \"kafka\"}",
  5. "kafkaConfig": "{\"uuid\": \"8b2b9dfe-777c-4d39-bf89-8472ec919193\",\"last_modified\": 0,\"version\": \"3.0.0.20500\",\"name\": \"DEFAULT.KYLIN_STREAMING_TABLE\",\"clusters\": [{\"uuid\": null,\"last_modified\": 0,\"version\": \"3.0.0.20500\",\"brokers\": [{\"id\": 0,\"host\": \"localhost\",\"port\": 9092}]}],\"topic\": \"kylin_streaming_topic\",\"timeout\": 60000,\"parserName\": \"org.apache.kylin.source.kafka.TimedJsonStreamParser\",\"timestampField\": \"order_time\",\"margin\": 0,\"splitRows\": 1000000,\"parserProperties\": null}",
  6. "successful": true,
  7. "message": null
  8. }

Update streaming schema

PUT /kylin/api/streaming

Request body

(Same as “Create streaming schema)

Request sample

(Same as “Create streaming schema)

Response sample

(Same as “Create streaming schema)


Get users can query the table

GET /kylin/api/acl/table/{project}/{type}/{table}

Path variable

  • project - required string projectName to which table belongs
  • type - required string user or group
  • table - required string table name

Get users cannot query the table

GET /kylin/api/acl/table/{project}/{type}/black/{table}

Path variable

  • project - required string projectName to which table belongs
  • type - required string user or group
  • table - required string table name

Put user to table blacklist

DELETE /kylin/api/table/{project}/{type}/{table}/{name}

Path variable

  • project - required string projectName to which table belongs
  • type - required string user or group
  • table - required string table name
  • name - required string user name or group name you want to put to table blacklist

Delete user from table blacklist

POST /kylin/api/table/{project}/{type}/{table}/{name}

Path variable

  • project - required string projectName to which table belongs
  • type - required string user or group
  • table - required string table name
  • name - required string user name or group name you want to delete from table blacklist

Use RESTful API in Javascript

Keypoints of call Kylin RESTful API in web page are:

  1. Add basic access authorization info in http headers.

  2. Use proper request type and data synax.

Kylin security is based on basic access authorization, if you want to use API in your javascript, you need to add authorization info in http headers; for example:

  1. $.ajaxSetup({
  2. headers: { 'Authorization': "Basic eWFu**********X***ZA==", 'Content-Type': 'application/json;charset=utf-8' } // use your own authorization code here
  3. });
  4. var request = $.ajax({
  5. url: "http://hostname/kylin/api/query",
  6. type: "POST",
  7. data: '{"sql":"select count(*) from SUMMARY;","offset":0,"limit":50000,"acceptPartial":true,"project":"test"}',
  8. dataType: "json"
  9. });
  10. request.done(function( msg ) {
  11. alert(msg);
  12. });
  13. request.fail(function( jqXHR, textStatus ) {
  14. alert( "Request failed: " + textStatus );
  15. });

To generate your authorization code, download and import “jquery.base64.js” from https://github.com/yckart/jquery.base64.js).

  1. var authorizationCode = $.base64('encode', 'NT_USERNAME' + ":" + 'NT_PASSWORD');
  2. $.ajaxSetup({
  3. headers: {
  4. 'Authorization': "Basic " + authorizationCode,
  5. 'Content-Type': 'application/json;charset=utf-8'
  6. }
  7. });