Skip to content

Commit

Permalink
[AMORO-3414] Fix syntax errors in postgresql scripts (#3415)
Browse files Browse the repository at this point in the history
Co-authored-by: jzjsnow <[email protected]>
  • Loading branch information
Jzjsnow and jzjsnow authored Jan 21, 2025
1 parent 3896bbe commit f2dabe8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
3 changes: 1 addition & 2 deletions amoro-ams/src/main/resources/postgres/ams-postgres-init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ COMMENT ON COLUMN table_runtime.last_optimized_change_snapshotId IS 'Last optimi
COMMENT ON COLUMN table_runtime.last_major_optimizing_time IS 'Latest Major Optimize time for all partitions';
COMMENT ON COLUMN table_runtime.last_minor_optimizing_time IS 'Latest Minor Optimize time for all partitions';
COMMENT ON COLUMN table_runtime.last_full_optimizing_time IS 'Latest Full Optimize time for all partitions';
COMMENT ON COLUMN table_runtime.optimizing_status_code IS 'Table optimize status code: 100(FULL_OPTIMIZING),' ||
' 200(MAJOR_OPTIMIZING), 300(MINOR_OPTIMIZING), 400(COMMITTING), 500(PLANING), 600(PENDING), 700(IDLE)';
COMMENT ON COLUMN table_runtime.optimizing_status_code IS 'Table optimize status code: 100(FULL_OPTIMIZING), 200(MAJOR_OPTIMIZING), 300(MINOR_OPTIMIZING), 400(COMMITTING), 500(PLANING), 600(PENDING), 700(IDLE)';
COMMENT ON COLUMN table_runtime.optimizing_status_start_time IS 'Table optimize status start time';
COMMENT ON COLUMN table_runtime.optimizing_process_id IS 'Optimizing procedure UUID';
COMMENT ON COLUMN table_runtime.optimizer_group IS 'Optimizer group';
Expand Down
35 changes: 18 additions & 17 deletions amoro-ams/src/main/resources/postgres/upgrade.sql
Original file line number Diff line number Diff line change
Expand Up @@ -86,36 +86,37 @@ COMMENT ON COLUMN http_session.max_interval IS 'Max internal';
COMMENT ON COLUMN http_session.data_store IS 'Session data store';
COMMENT ON TABLE http_session IS 'Http session store';

-- update resource group memory unit
-- update resource group memory unit
UPDATE resource_group
SET properties = jsonb_set(
properties,
'{flink-conf,jobmanager,memory,process,size}',
(properties->>'flink-conf.jobmanager.memory.process.size') || 'MB'
properties::jsonb,
'{flink-conf.jobmanager.memory.process.size}',
('"' || (properties::jsonb->>'flink-conf.jobmanager.memory.process.size') || 'MB"')::jsonb
)
WHERE (properties->>'flink-conf.jobmanager.memory.process.size') ~ '^[0-9]+$';
WHERE (properties::jsonb->>'flink-conf.jobmanager.memory.process.size') ~ '^[0-9]+$';


UPDATE resource_group
SET properties = jsonb_set(
properties,
'{flink-conf,taskmanager,memory,process,size}',
(properties->>'flink-conf.taskmanager.memory.process.size') || 'MB'
properties::jsonb,
'{flink-conf.taskmanager.memory.process.size}',
('"' || (properties::jsonb->>'flink-conf.taskmanager.memory.process.size') || 'MB"')::jsonb
)
WHERE (properties->>'flink-conf.taskmanager.memory.process.size') ~ '^[0-9]+$';
WHERE (properties::jsonb->>'flink-conf.taskmanager.memory.process.size') ~ '^[0-9]+$';

-- update resource memory unit
UPDATE resource
SET properties = jsonb_set(
properties,
'{flink-conf,jobmanager,memory,process,size}',
(properties->>'flink-conf.jobmanager.memory.process.size') || 'MB'
properties::jsonb,
'{flink-conf.jobmanager.memory.process.size}',
('"' || (properties::jsonb->>'flink-conf.jobmanager.memory.process.size') || 'MB"')::jsonb
)
WHERE (properties->>'flink-conf.jobmanager.memory.process.size') ~ '^[0-9]+$';
WHERE (properties::jsonb->>'flink-conf.jobmanager.memory.process.size') ~ '^[0-9]+$';

UPDATE resource
SET properties = jsonb_set(
properties,
'{flink-conf,taskmanager,memory,process,size}',
(properties->>'flink-conf.taskmanager.memory.process.size') || 'MB'
properties::jsonb,
'{flink-conf.taskmanager.memory.process.size}',
('"' || (properties::jsonb->>'flink-conf.taskmanager.memory.process.size') || 'MB"')::jsonb
)
WHERE (properties->>'flink-conf.taskmanager.memory.process.size') ~ '^[0-9]+$';
WHERE (properties::jsonb->>'flink-conf.taskmanager.memory.process.size') ~ '^[0-9]+$';

0 comments on commit f2dabe8

Please sign in to comment.