You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2021/09/24 13:42:34 UTC
[incubator-doris] branch master updated: [HTTP API] Add aggregation
type information in table schema api (#6686)
This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new f73af47 [HTTP API] Add aggregation type information in table schema api (#6686)
f73af47 is described below
commit f73af475cede584b7a2625500bbe986a48190638
Author: zhuixun <49...@qq.com>
AuthorDate: Fri Sep 24 21:42:24 2021 +0800
[HTTP API] Add aggregation type information in table schema api (#6686)
```
{
"msg": "success",
"code": 0,
"data": {
"properties": [{
"type": "INT",
"name": "k1",
"comment": "",
"aggregation_type":""
}, {
"type": "INT",
"name": "k2",
"comment": "",
"aggregation_type":"MAX"
}],
"status": 200
},
"count": 0
}
```
---
docs/en/administrator-guide/http-actions/fe/table-schema-action.md | 6 ++++--
.../administrator-guide/http-actions/fe/table-schema-action.md | 6 ++++--
.../src/main/java/org/apache/doris/http/rest/TableSchemaAction.java | 3 +++
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/docs/en/administrator-guide/http-actions/fe/table-schema-action.md b/docs/en/administrator-guide/http-actions/fe/table-schema-action.md
index 9290975..519d1ba 100644
--- a/docs/en/administrator-guide/http-actions/fe/table-schema-action.md
+++ b/docs/en/administrator-guide/http-actions/fe/table-schema-action.md
@@ -62,11 +62,13 @@ None
"properties": [{
"type": "INT",
"name": "k1",
- "comment": ""
+ "comment": "",
+ "aggregation_type":""
}, {
"type": "INT",
"name": "k2",
- "comment": ""
+ "comment": "",
+ "aggregation_type":"MAX"
}],
"status": 200
},
diff --git a/docs/zh-CN/administrator-guide/http-actions/fe/table-schema-action.md b/docs/zh-CN/administrator-guide/http-actions/fe/table-schema-action.md
index 8b21046..9c13b96 100644
--- a/docs/zh-CN/administrator-guide/http-actions/fe/table-schema-action.md
+++ b/docs/zh-CN/administrator-guide/http-actions/fe/table-schema-action.md
@@ -62,11 +62,13 @@ under the License.
"properties": [{
"type": "INT",
"name": "k1",
- "comment": ""
+ "comment": "",
+ "aggregation_type":""
}, {
"type": "INT",
"name": "k2",
- "comment": ""
+ "comment": "",
+ "aggregation_type":"MAX"
}],
"status": 200
},
diff --git a/fe/fe-core/src/main/java/org/apache/doris/http/rest/TableSchemaAction.java b/fe/fe-core/src/main/java/org/apache/doris/http/rest/TableSchemaAction.java
index e298042..9000ae4 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/http/rest/TableSchemaAction.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/http/rest/TableSchemaAction.java
@@ -43,6 +43,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import io.netty.handler.codec.http.HttpMethod;
import io.netty.handler.codec.http.HttpResponseStatus;
@@ -101,6 +102,8 @@ public class TableSchemaAction extends RestBaseAction {
baseInfo.put("type", primitiveType.toString());
baseInfo.put("comment", column.getComment());
baseInfo.put("name", column.getDisplayName());
+ Optional aggregationType = Optional.ofNullable(column.getAggregationType());
+ baseInfo.put("aggregation_type", aggregationType.isPresent() ? column.getAggregationType().toSql() : "");
propList.add(baseInfo);
}
resultMap.put("status", 200);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org