aiagent/skill/embedded/builtin/query-datasource/datasources/doris.md
dorisPOST /api/n9e/db-databases
Authorization: Bearer <token>
Content-Type: application/json
Body: {"cate": "doris", "datasource_id": 1, "query": []}
POST /api/n9e/db-tables
Authorization: Bearer <token>
Content-Type: application/json
Body: {"cate": "doris", "datasource_id": 1, "query": ["database_name"]}
POST /api/n9e/db-desc-table
Authorization: Bearer <token>
Content-Type: application/json
Body: {"cate": "doris", "datasource_id": 1, "query": [{"database": "logs_db", "table": "access_log"}]}
POST /api/n9e/logs-query
Authorization: Bearer <token>
Content-Type: application/json
{
"cate": "doris",
"datasource_id": 1,
"query": [
{
"sql": "SELECT * FROM logs_db.access_log WHERE log_time >= FROM_UNIXTIME($from) AND log_time < FROM_UNIXTIME($to) AND message LIKE '%error%' ORDER BY log_time DESC LIMIT 100",
"from": 1712000000,
"to": 1712003600,
"database": "logs_db"
}
]
}
POST /api/n9e/ds-query
Authorization: Bearer <token>
Content-Type: application/json
{
"cate": "doris",
"datasource_id": 1,
"query": [
{
"sql": "SELECT DATE_TRUNC(log_time, INTERVAL 1 MINUTE) AS ts, COUNT(*) AS value FROM logs_db.access_log WHERE log_time >= FROM_UNIXTIME($from) AND log_time < FROM_UNIXTIME($to) GROUP BY ts ORDER BY ts",
"from": 1712000000,
"to": 1712003600,
"database": "logs_db",
"keys": {
"valueKey": "value",
"labelKey": "",
"timeKey": "ts"
}
}
]
}
| Field | Type | Required | Description |
|---|---|---|---|
sql | string | Yes | SQL query statement, supports $from and $to time variables |
from | int64 | Yes | Start time, Unix timestamp (seconds) |
to | int64 | Yes | End time, Unix timestamp (seconds) |
database | string | Yes | Database name (required for Doris) |
keys.valueKey | string | No | Numeric column name (required for time-series queries) |
keys.labelKey | string | No | Label/grouping column name |
keys.timeKey | string | No | Time column name |
database fieldDATE_TRUNC(), NOW(), FROM_UNIXTIME(), etc.