THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!

Apache Kylin : Analytical Data Warehouse for Big Data

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

POST /kylin/api/cubes

Request Body

Variable name

NecessaryTypeDescription
cubeDescDatayesstringcubeDescData to create
cubeNameyesstringcubeName to create
projectNameyesstringprojectName to which cube belongs
  • cubeDescData - required. string. cubeDescData to create
  • cubeName - required. string. cubeName to create
  • projectName - required. string. projectName to which cube belongs

...

GET /kylin/api/cubes

Request Body

Variable name

NecessaryTypeDescription
offsetnointOffset used by pagination
limitnointCubes per page
cubeNamenostringKeyword for cube names. To find cubes whose name contains this keyword.
projectNamenostringProject name.

Response Sample

Code Block
languagejs
titleSample
linenumberstrue
collapsetrue
[
    {
        "uuid": "2fbca32a-a33e-4b69-83dd-0bb8b1f8c53b",
        "last_modified": 1594810840000,
        "version": "3.9.9.1",
        "name": "kylin_sales_cube",
        "owner": "ADMIN",
        "descriptor": "kylin_sales_cube",
        "display_name": null,
        "cost": 786,
        "status": "READY",
        "segments": [
            {
                "uuid": "5d41643a-6178-d7f3-ef91-08592392dc61",
                "name": "20120101000000_20120201000000",
                "storage_location_identifier": "36C",
                "date_range_start": 1325376000000,
                "date_range_end": 1328054400000,
                "source_offset_start": 0,
                "source_offset_end": 0,
                "status": "READY",
                "size_kb": 2976,
                "is_merged": false,
                "estimate_ratio": null,
                "input_records": 459,
                "input_records_size": 1777714,
                "last_build_time": 1594870043600,
                "last_build_job_id": "7557fd46-1431-4c88-845a-1b3fd06efe06",
                "create_time_utc": 1594869860595,
                "cuboid_shard_nums": {
                    "23471": 1,
                    "21423": 1,
                    "22703": 1,
                    "17327": 1,
                    "16559": 1,
                    "20655": 1,
                    "23792": 1,
                    "32752": 1,
                    "24560": 1,
                    "31984": 1,
                    "23536": 1,
                    "21488": 1,
                    "22768": 1,
                    "17392": 1,
                    "16624": 1,
                    "20720": 1,
                    "23795": 1,
                    "32755": 1,
                    "24563": 1,
                    "31987": 1,
                    "23539": 1,
                    "21491": 1,
                    "22771": 1,
                    "20723": 1,
                    "17395": 1,
                    "16627": 1,
                    "24572": 1,
                    "262143": 1,
                    "32764": 1,
                    "31996": 1,
                    "23548": 1,
                    "23804": 1,
                    "21500": 1,
                    "22780": 1,
                    "17404": 1,
                    "16636": 1,
                    "20732": 1,
                    "23807": 1,
                    "32767": 1,
                    "24575": 1,
                    "31999": 1,
                    "23551": 1,
                    "22783": 1,
                    "21503": 1,
                    "20735": 1,
                    "17407": 1,
                    "16639": 1
                },
                "total_shards": 0,
                "blackout_cuboids": [
                    
                ],
                "binary_signature": null,
                "dictionaries": null,
                "snapshots": {
                    "DEFAULT.KYLIN_CAL_DT": "learn_kylin/table_snapshot/DEFAULT.KYLIN_CAL_DT/7c810b15-b8a0-4094-99ef-5a3de465ea77",
                    "DEFAULT.KYLIN_CATEGORY_GROUPINGS": "learn_kylin/table_snapshot/DEFAULT.KYLIN_CATEGORY_GROUPINGS/2f18cd7e-7378-465a-87fa-07ccf951232b",
                    "DEFAULT.KYLIN_ACCOUNT": "learn_kylin/table_snapshot/DEFAULT.KYLIN_ACCOUNT/d5ab0a04-58b3-4368-9a8e-2ea309e43aa2",
                    "DEFAULT.KYLIN_COUNTRY": "learn_kylin/table_snapshot/DEFAULT.KYLIN_COUNTRY/304f3e36-2020-42c2-a65b-eef0654a3c73"
                },
                "rowkey_stats": [
                    
                ],
                "stream_source_checkpoint": null,
                "additionalInfo": {
                    "storageType": "4"
                }
            }
        ],
        "create_time_utc": 0,
        "cuboid_bytes": null,
        "cuboid_bytes_recommend": null,
        "cuboid_last_optimized": 0,
        "snapshots": {
            
        },
        "project": "learn_kylin",
        "model": "kylin_sales_model",
        "is_streaming": false,
        "partitionDateColumn": "KYLIN_SALES.PART_DT",
        "partitionDateStart": 1325376000000,
        "isStandardPartitioned": true,
        "size_kb": 2976,
        "input_records_count": 459,
        "input_records_size": 1777714
    }
]

...

GET /kylin/api/cubes/{cubeName}

Path Variable

Variable name

NecessaryTypeDescription
cubeNameyesstringCube name to find

Get cube descriptor

GET /kylin/api/cube_desc/{cubeName}

Path Variable

Variable name

NecessaryTypeDescription
cubeNameyesstringCube name you want to get desc

Build cube

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

Path Variable

Variable name

NecessaryTypeDescription
cubeNameyesstringCube name you want to build

Request Body

Variable name

NecessaryTypeDescription
startTimeyeslongStart timestamp of data to build, e.g. 1388563200000 for 2014-1-1
endTimeyeslongEnd timestamp of data to build
buildTypeyesstringSupported build type: ‘BUILD’, ‘MERGE’, ‘REFRESH’

Request Sample

Code Block
languagejs
titleSample
linenumberstrue
collapsetrue
{
    "startTime": "1423526400000",
    "endTime": "1423612800000",
    "buildType": "BUILD"
}

...

Code Block
languagejs
titleSample
linenumberstrue
collapsetrue
{
    "uuid": "40216a6a-8b2e-4577-bd02-480438d08277",
    "last_modified": 1594887791604,
    "version": "3.9.9.1",
    "name": "INDEX_BUILD CUBE - kylin_test_cube - 20150210000000_20150211000000 - CST 2020-07-16 16:23:11",
    "projectName": "learn_kylin",
    "type": "BUILD",
    "duration": 0,
    "related_cube": "kylin_test_cube",
    "display_cube_name": "kylin_test_cube",
    "related_segment": "fcbd7527-4d97-9e3c-f88a-ca2c54fbe443",
    "related_segment_name": null,
    "exec_start_time": 0,
    "exec_end_time": 0,
    "exec_interrupt_time": 0,
    "mr_waiting": 0,
    "steps": [
        {
            "interruptCmd": null,
            "id": "40216a6a-8b2e-4577-bd02-480438d08277-00",
            "name": "Detect Resource",
            "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": "40216a6a-8b2e-4577-bd02-480438d08277-01",
            "name": "Build Cube with Spark",
            "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
        }
    ],
    "submitter": "ADMIN",
    "job_status": "PENDING",
    "build_instance": "unknown",
    "progress": 0.0
}

Optimize Cube

PUT /kylin/api/cubes/{cubeName}/optimize2
Describe: Send a optimize cube job for delete or add cuboid

Path variable

Variable name

NecessaryTypeDescription
cubeNameyesstringCube name you want to enable

Request Body

Variable name

NecessaryTypeDescription

cuboidsAdd

yesstring The cuboid id you want to add
cuboidsDeleteyesstringThe cuboid id you want to delete

Request Sample

Code Block
languagejs
titleSample
linenumberstrue
collapsetrue
{
    "cuboidsAdd":["87361"],

    "cuboidsDelete":["16636"]
}

Response Sample

Code Block
languagejs
titleSample
collapsetrue
JobInstance xmlns="">
    <uuid>2f75ef64-faa7-9c54-8ca7-a6aabd1c8a62</uuid>
    <last_modified>1627876186386</last_modified>
    <version>4.0.0.0</version>
    <name>kylin_sales_cube - OPTIMIZE CHECKPOINT - CST 2021-08-02 11:49:46</name>
    <projectName>learn_kylin</projectName>
    <type>CHECKPOINT</type>
    <duration>0</duration>
    <related_cube>kylin_sales_cube</related_cube>
    <display_cube_name>kylin_sales_cube</display_cube_name>
    <related_segment/>
    <related_segment_name/>
    <exec_start_time>0</exec_start_time>
    <exec_end_time>0</exec_end_time>
    <exec_interrupt_time>0</exec_interrupt_time>
    <mr_waiting>0</mr_waiting>
    <steps>
        <steps>
            <interruptCmd/>
            <id>2f75ef64-faa7-9c54-8ca7-a6aabd1c8a62-00</id>
            <name>Update Cube Info</name>
            <sequence_id>0</sequence_id>
            <exec_cmd/>
            <interrupt_cmd/>
            <exec_start_time>0</exec_start_time>
            <exec_end_time>0</exec_end_time>
            <exec_wait_time>0</exec_wait_time>
            <step_status>PENDING</step_status>
            <cmd_type>SHELL_CMD_HADOOP</cmd_type>
            <info></info>
            <run_async>false</run_async>
        </steps>
        <steps>
            <interruptCmd/>
            <id>2f75ef64-faa7-9c54-8ca7-a6aabd1c8a62-01</id>
            <name>Garbage Collection on HDFS</name>
            <sequence_id>1</sequence_id>
            <exec_cmd/>
            <interrupt_cmd/>
            <exec_start_time>0</exec_start_time>
            <exec_end_time>0</exec_end_time>
            <exec_wait_time>0</exec_wait_time>
            <step_status>PENDING</step_status>
            <cmd_type>SHELL_CMD_HADOOP</cmd_type>
            <info></info>
            <run_async>false</run_async>
        </steps>
    </steps>
    <submitter>ADMIN</submitter>
    <job_status>PENDING</job_status>
    <build_instance>unknown</build_instance>
    <progress>0.0</progress>
</JobInstance>

Enable Cube

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

Path variable

Variable name

NecessaryTypeDescription
cubeNameyesstringCube name you want to enable

Disable Cube

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

Path variable

Variable name

NecessaryTypeDescription
cubeNameyesstringCube name you want to disable

Purge Cube

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

Path variable

Variable name

NecessaryTypeDescription
cubeNameyesstringCube name you want to purge

Delete Segment

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

...

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

Path variable

Variable name

NecessaryTypeDescription
cubeNameyesstringCube name you want to rebuild lookup table snapshot
segmentNameyesstringSegment name

Request Parameters

Variable name

NecessaryTypeDescription
lookupTableyesstring Lookup table name you want to refresh

Clone cube

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

Path variable

Variable name

NecessaryTypeDescription
cubeNameyesstring  The name of cube you want to clone

Request Body

Variable name

NecessaryTypeDescription
cubeNameyesstring The name of new cloned cube
projectyesstringProject which new cloned cube belong to

Request Sample

Code Block
languagejs
titleSample
linenumberstrue
collapsetrue
{
    "cubeName":"test_clone_cube",
    "project":"learn_kylin"
}

Response Sample

Code Block
languagejs
titleSample
linenumberstrue
collapsetrue
{
    "uuid": "c4e58e1e-2f44-dd61-4f1f-ef3e4ea68b5b",
    "last_modified": 1594899272048,
    "version": "3.9.9.1",
    "name": "test_clone_cube",
    "owner": "ADMIN",
    "descriptor": "test_clone_cube",
    "display_name": "test_clone_cube",
    "cost": 50,
    "status": "DISABLED",
    "segments": [],
    "create_time_utc": 1594899272048,
    "cuboid_bytes": null,
    "cuboid_bytes_recommend": null,
    "cuboid_last_optimized": 0,
    "snapshots": {}
}

...

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

Response Sample

Code Block
languagejs
titleSample
linenumberstrue
collapsetrue
[
    {
        "storageType": "parquet",
        "segmentName": "20120101000000_20120201000000",
        "segmentUUID": null,
        "segmentStatus": "READY",
        "tableName": "TD4",
        "tableSize": 0,
        "regionCount": 0,
        "dateRangeStart": 1325376000000,
        "dateRangeEnd": 1328054400000,
        "sourceOffsetStart": 0,
        "sourceOffsetEnd": 0,
        "sourceCount": 459
    },
    {
        "storageType": "parquet",
        "segmentName": "20120201000000_20120301000000",
        "segmentUUID": null,
        "segmentStatus": "READY",
        "tableName": "VVW",
        "tableSize": 0,
        "regionCount": 0,
        "dateRangeStart": 1328054400000,
        "dateRangeEnd": 1330560000000,
        "sourceOffsetStart": 0,
        "sourceOffsetEnd": 0,
        "sourceCount": 367
    }
]

...