flyrain commented on code in PR #945:
URL: https://github.com/apache/polaris/pull/945#discussion_r1943794155


##########
polaris-core/src/main/resources/schemas/policies/system/data-compaction/2025-02-03.json:
##########
@@ -0,0 +1,41 @@
+{
+  "license": "Licensed under the Apache License, Version 2.0 
(http://www.apache.org/licenses/LICENSE-2.0)",
+  "$id": 
"https://polaris.apache.org/schemas/policies/system/data-compaction/2025-02-03.json";,
+  "title": "Data Compaction Policy",
+  "description": "Inheritable Polaris policy schema for Iceberg table data 
compaction.",
+  "type": "object",
+  "properties": {
+    "version": {
+      "type": "string",
+      "const": "2025-02-03",
+      "description": "Schema version."
+    },
+    "enable": {
+      "type": "boolean",
+      "description": "Enable or disable data compaction."
+    },
+    "target_file_size_bytes": {
+      "type": "number",
+      "description": "Target data file size in bytes."
+    },
+    "config": {
+      "type": "object",
+      "description": "A map containing custom configuration properties. Please 
note that interoperability is not guaranteed.",

Review Comment:
   I agreed that we should promoting interoperability as much as possible, 
that's the point of the policy schema. However, there are use cases to support 
optional features of each TMS, e.g., TMS X has a optional feature `f1`, only a 
small set of tables need it, users can select `f1` via `config` map. TMS Y 
should ignore `f1` and is OK to ignore it.
   
   In case of a new policy type, a new schema and a new validator have to be 
introduced. Check [design 
doc](https://docs.google.com/document/d/1kIiVkFFg9tPa5SH70b9WwzbmclrzH3qWHKfCKXw5lbs/edit?tab=t.0#heading=h.p1y3rk8iury8)
 section "Policy Content Schema" and "Policy Validation" for more details. 
Other TMSs or engines need to upgrade to recognize it. It's like adding a new 
endpoint in a web service. To be clear, we are talking about new schemas, which 
is supposed to be rare, engines can always recognize new policies with old 
schemas.



-- 
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