justinmclean commented on code in PR #8229:
URL: https://github.com/apache/gravitino/pull/8229#discussion_r2289567102


##########
docs/manage-statistics-in-gravitino.md:
##########
@@ -0,0 +1,201 @@
+---
+title: "Manage tags in Gravitino"
+slug: /manage-tags-in-gravitino
+date: 2024-07-24
+keyword: tag management, tag, tags, Gravitino
+license: This software is licensed under the Apache License version 2.
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+## Introduction
+
+Starting from 1.0.0, Gravitino introduces statistics of table and partitions.
+
+This document briefly introduces how to use statistics in Gravitino by both 
Gravitino Java client and
+REST APIs. If you want to know more about the statistics system in Gravitino, 
please refer to the
+Javadoc and REST API documentation.
+
+Note that current statistics system is a basic implementation, some advanced 
features will be added in
+the future versions.
+
+
+## Table Statistic operations
+
+### Update table statistics
+
+You can update statistics of a table by providing the statistics key and value.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X PUT -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{
+  "updates" : {
+      "custom-k1":"v1"
+  }
+}' 
http://localhost:8090/api/metalakes/metalake/catalogs/catalog/schemas/schema/tables/table/statistics
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+Table table = ...
+Map<String, StatisticValue<?>> updateStatistics = Maps.newHashMap();
+updateStatistics.put("custom-k1", StatisticValues.stringValue("v1"));
+updateStatistics.put("custom-k2", StatisticValues.stringValue("v2"));
+table.supportsStatistics().updateStatistics(updateStatistics);
+```
+
+</TabItem>
+</Tabs>
+
+### List statistics of tables
+
+You can list all the statistics of a table.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
+ -H "Content-Type: application/json" \
+ 
http://localhost:8090/api/metalakes/metalake/catalogs/catalog/schemas/schema/tables/table/statistics
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+Table table = ...
+table.supportsStatistics().listStatistics();
+```
+
+</TabItem>
+</Tabs>
+
+### Drop statistics of tables
+
+You can drop statistics of a table by providing the statistics keys.
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+ -H "Content-Type: application/json" -d '{
+ "names":["custom-k1"]
+}' 
http://localhost:8090/api/metalakes/metalake/catalogs/catalog/schemas/schema/tables/table/statistics
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+Table table = ...
+List<String> statisticsToDrop = Lists.newArrayList("custom-k1");
+table.supportsStatistics().dropStatistics(statisticsToDrop);
+```
+
+</TabItem>
+</Tabs>
+
+### Partition statistics operations
+
+### Update statistics of partitions
+
+You can update statistics of a partition by providing the statistics key and 
value.

Review Comment:
   update the statistics



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to