Table Schema Action
Request
GET /api/<db>/<table>/_schema
デスクリプション
指定されたTableのTable構造情報を取得するために使用されます。このインターフェースは現在Spark/Flink Doris Connectorで使用されており、DorisTable構造情報を取得します。
Path parameters
-
<db>データベースを指定
-
<table>Tableを指定
Query parameters
なし
Request body
なし
Response
- httpインターフェースは以下のように返します:
{
"msg": "success",
"code": 0,
"data": {
"properties": [{
"type": "INT",
"name": "k1",
"comment": "",
"aggregation_type":""
}, {
"type": "INT",
"name": "k2",
"comment": "",
"aggregation_type":"MAX"
}],
"keysType":UNIQUE_KEYS,
"status": 200
},
"count": 0
}
- http v2インターフェースは以下のように返却します:
{
"msg": "success",
"code": 0,
"data": {
"properties": [{
"type": "INT",
"name": "k1",
"comment": ""
}, {
"type": "INT",
"name": "k2",
"comment": ""
}],
"keysType":UNIQUE_KEYS,
"status": 200
},
"count": 0
}
注意: 違いは、httpメソッドがhttp v2メソッドよりも多くのaggregation_typeフィールドを返すことです。http v2はenable_http_server_v2を設定することで有効になります。詳細なパラメータの説明については、fe parameter settingsを参照してください。
Examples
-
httpインターフェースを介して指定されたTableのTable構造情報を取得します。
GET /api/db1/tbl1/_schema
Response:
{
"msg": "success",
"code": 0,
"data": {
"properties": [{
"type": "INT",
"name": "k1",
"comment": "",
"aggregation_type":""
}, {
"type": "INT",
"name": "k2",
"comment": "",
"aggregation_type":"MAX"
}],
"keysType":UNIQUE_KEYS,
"status": 200
},
"count": 0
} -
http v2 インターフェースを介して指定されたTableのTable構造情報を取得します。
GET /api/db1/tbl1/_schema
Response:
{
"msg": "success",
"code": 0,
"data": {
"properties": [{
"type": "INT",
"name": "k1",
"comment": ""
}, {
"type": "INT",
"name": "k2",
"comment": ""
}],
"keysType":UNIQUE_KEYS,
"status": 200
},
"count": 0
}