yuqi1129 commented on code in PR #11033:
URL: https://github.com/apache/gravitino/pull/11033#discussion_r3232284534
##########
core/src/main/java/org/apache/gravitino/storage/relational/mapper/provider/base/OwnerMetaBaseSQLProvider.java:
##########
@@ -260,13 +260,18 @@ public String selectOwnerByMetadataObjectIdAndType(
+ " ORDER BY updated_at DESC, id DESC LIMIT 1";
}
- public String selectChangedOwners(@Param("updatedAtFrom") long
updatedAtFrom) {
- return "SELECT metadata_object_id as metadataObjectId,"
+ public String selectChangedOwners(@Param("lastId") long lastId) {
+ return "SELECT id,"
+ + " metadata_object_id as metadataObjectId,"
+ " metadata_object_type as metadataObjectType,"
+ " updated_at as updatedAt"
+ " FROM "
+ OWNER_TABLE_NAME
- + " WHERE deleted_at = 0 AND updated_at >= #{updatedAtFrom}"
- + " ORDER BY updated_at, id LIMIT 1000";
+ + " WHERE deleted_at = 0 AND id > #{lastId}"
+ + " ORDER BY id LIMIT 1000";
+ }
+
+ public String selectLatestChangeId() {
+ return "SELECT COALESCE(MAX(id), 0) FROM " + OWNER_TABLE_NAME + " WHERE
deleted_at = 0";
}
Review Comment:
I see.
--
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]