mchades commented on code in PR #7842:
URL: https://github.com/apache/gravitino/pull/7842#discussion_r2262835334


##########
core/src/main/java/org/apache/gravitino/storage/relational/mapper/provider/base/PolicyMetaBaseSQLProvider.java:
##########
@@ -73,6 +73,27 @@ public String listPolicyPOsByMetalakeAndPolicyNames(
         + "</script>";
   }
 
+  public String listDiffPolicyPOsByMetalakeIdAndPolicy(
+      @Param("metalakeId") Long metalakeId, @Param("policy") PolicyPO 
policyPO) {
+    return "SELECT pm.policy_id, pm.policy_name, pm.policy_type, 
pm.metalake_id, pm.inheritable,"
+        + " pm.exclusive, pm.supported_object_types, pm.audit_info, 
pm.current_version, pm.last_version,"
+        + " pm.deleted_at, pvi.id, pvi.metalake_id as version_metalake_id, 
pvi.policy_id as version_policy_id,"
+        + " pvi.version, pvi.policy_comment, pvi.enabled, pvi.content, 
pvi.deleted_at as version_deleted_at"
+        + " FROM "
+        + POLICY_META_TABLE_NAME
+        + " pm JOIN "
+        + POLICY_VERSION_TABLE_NAME
+        + " pvi ON pm.policy_id = pvi.policy_id"
+        + " AND pm.current_version = pvi.version"
+        + " WHERE pm.metalake_id = #{metalakeId}"
+        + " AND pm.policy_id != #{policy.policyId}"
+        + " AND pm.policy_type = #{policy.policyType}"
+        + " AND (pm.inheritable != #{policy.inheritable} OR"
+        + " pm.exclusive != #{policy.exclusive} OR"
+        + " pm.supported_object_types != #{policy.supportedObjectTypes})"
+        + " AND pm.deleted_at = 0 AND pvi.deleted_at = 0";
+  }

Review Comment:
   JavaDoc comment added



-- 
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: commits-unsubscr...@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to