roryqi commented on code in PR #11266: URL: https://github.com/apache/gravitino/pull/11266#discussion_r3324059752
########## scripts/h2/schema-1.3.0-h2.sql: ########## @@ -612,3 +612,22 @@ CREATE TABLE IF NOT EXISTS `entity_change_log` ( PRIMARY KEY (`id`), KEY `idx_ecl_created_at` (`created_at`) ) ENGINE=InnoDB COMMENT='Append-only log of entity structural changes for targeted metadataIdCache invalidation'; + +CREATE TABLE IF NOT EXISTS `iceberg_cleanup_job` ( + `id` BIGINT NOT NULL, + `catalog_id` BIGINT NOT NULL COMMENT 'globally unique id of the owning catalog, stable across catalog rename', + `namespace` VARCHAR(512) NOT NULL, + `table_name` VARCHAR(256) NOT NULL, + `metadata_location` CLOB NOT NULL, + `file_io_impl` VARCHAR(256) NOT NULL, + `file_io_props` CLOB NOT NULL COMMENT 'JSON', + `state` VARCHAR(16) NOT NULL COMMENT 'PENDING|RUNNING|SUCCEEDED|FAILED', + `attempts` INT NOT NULL DEFAULT 0, + `last_error` VARCHAR(2048) NULL COMMENT 'truncated reason for the most recent failure, NULL until a job fails', + `heartbeat_at` BIGINT NOT NULL DEFAULT 0 COMMENT 'last heartbeat from the worker, 0 when not running', + `created_by` VARCHAR(128) NOT NULL COMMENT 'principal that requested the drop (audit)', + `updated_at` BIGINT NOT NULL COMMENT 'last state change, drives poll ordering and old finished-job cleanup', + PRIMARY KEY (`id`) +) COMMENT='async Iceberg table cleanup jobs'; +CREATE INDEX IF NOT EXISTS `idx_state_updated` ON `iceberg_cleanup_job` (`state`, `updated_at`); +CREATE INDEX IF NOT EXISTS `idx_object` ON `iceberg_cleanup_job` (`catalog_id`, `namespace`, `table_name`, `state`); Review Comment: OK, I just check the changes. I don't see the whole patch. -- 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]
