Table Schema Action

Request

GET /api/<db>/<table>/_schema

Description

用于获取指定表的表结构信息。该接口目前用于 Spark-Doris-Connector 中,Spark 获取 Doris 的表结构信息。

Path parameters

  • <db>

    指定数据库

  • <table>

    指定表

Query parameters

Request body

Response

  1. {
  2. "msg": "success",
  3. "code": 0,
  4. "data": {
  5. "properties": [{
  6. "type": "INT",
  7. "name": "k1",
  8. "comment": "",
  9. "aggregation_type":""
  10. }, {
  11. "type": "INT",
  12. "name": "k2",
  13. "comment": "",
  14. "aggregation_type":"MAX"
  15. }],
  16. "status": 200
  17. },
  18. "count": 0
  19. }

Examples

  1. 获取指定表的表结构信息。

    1. GET /api/db1/tbl1/_schema
    2. Response:
    3. {
    4. "msg": "success",
    5. "code": 0,
    6. "data": {
    7. "properties": [{
    8. "type": "INT",
    9. "name": "k1",
    10. "comment": ""
    11. }, {
    12. "type": "INT",
    13. "name": "k2",
    14. "comment": ""
    15. }],
    16. "status": 200
    17. },
    18. "count": 0
    19. }