Apache Kylin : Analytical Data Warehouse for Big Data
Welcome to Kylin Wiki.
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
{
"sql":"select count(*) from kylin_sales",
"offset":0,
"limit":50000,
"acceptPartial":false,
"project": "learn_kylin"
}
Curl Example
curl -X POST -H "Authorization: Basic XXXXXXXXX" -H "Content-Type: application/json"
-d '{ "sql":"select count(*) from kylin_sales", "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
{
"columnMetas": [
{
"isNullable": 0,
"displaySize": 19,
"label": "EXPR$0",
"name": "EXPR$0",
"schemaName": null,
"catelogName": null,
"tableName": null,
"precision": 19,
"scale": 0,
"columnType": -5,
"columnTypeName": "BIGINT",
"autoIncrement": false,
"caseSensitive": true,
"searchable": false,
"currency": false,
"signed": true,
"writable": false,
"definitelyWritable": false,
"readOnly": true
}
],
"results": [
[
"459"
]
],
"cube": "CUBE[name=kylin_sales_cube]",
"affectedRowCount": 0,
"isException": false,
"exceptionMessage": null,
"duration": 2557,
"totalScanCount": 0,
"totalScanBytes": 0,
"hitExceptionCache": false,
"storageCacheUsed": false,
"traceUrl": null,
"partial": false,
"pushDown": false
}
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
{
"sql":"select count(*) from kylin_sales",
"offset":0,
"limit":50000,
"acceptPartial":false,
"project": "learn_kylin"
}
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
{ "sql": "select count(*) from kylin_sales", "name": "test", "project": "learn_kylin" }
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
[ { "name": "test", "project": "learn_kylin", "sql": "select count(*) from kylin_sales", "description": null, "id": "-1674470999" } ]
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 byGet running queries
.
List queryable tables
GET /kylin/api/tables_and_columns
Path Variable
- project -
required
string
The project to load tables
Response Sample
Overview
Content Tools
ThemeBuilder
Apps