MINOR: Fix cost analysis build failing for postgres (#20122)

This commit is contained in:
Mayur Singal 2025-03-07 03:00:28 +05:30 committed by GitHub
parent 70183eb11d
commit 46947277c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 5 deletions

View File

@ -5,13 +5,13 @@ WHERE json->>'type' IS NOT NULL;
-- Query Cost History Time Series
CREATE TABLE query_cost_time_series (
id varchar(36) GENERATED ALWAYS AS (json ->> 'id') STORED NOT NULL,
cost real GENERATED ALWAYS AS (json ->> 'cost') STORED NOT NULL,
count int GENERATED ALWAYS AS (json ->> 'count') STORED NOT NULL,
cost real GENERATED ALWAYS AS ((json ->> 'cost')::real) STORED NOT NULL,
count float GENERATED ALWAYS AS ((json ->> 'count')::float) STORED NOT NULL,
timestamp bigint GENERATED ALWAYS AS ((json ->> 'timestamp')::bigint) STORED NOT NULL,
jsonSchema varchar(256) NOT NULL,
json jsonb NOT NULL,
entityFQNHash varchar(768) COLLATE "C" DEFAULT NULL,
CONSTRAINT query_cost_unique_constraint UNIQUE (id, timestamp, entityFQNHash)
CONSTRAINT query_cost_unique_constraint UNIQUE (timestamp, entityFQNHash)
);
CREATE INDEX IF NOT EXISTS query_cost_time_series_id on query_cost_time_series (id);
CREATE INDEX IF NOT EXISTS query_cost_time_series_id_timestamp on test_case_resolution_status_time_series (id, timestamp);

View File

@ -5186,8 +5186,8 @@ public interface CollectionDAO {
value =
"INSERT INTO <table>(entityFQNHash, jsonSchema, json) "
+ "VALUES (:entityFQNHash, :jsonSchema, (:json :: jsonb)) "
+ "ON CONFLICT (entityFQNHash, timestamp)"
+ "DO UPDATE SET"
+ "ON CONFLICT (entityFQNHash, timestamp) "
+ "DO UPDATE SET "
+ "json = EXCLUDED.json",
connectionType = POSTGRES)
void insertWithoutExtension(

View File

@ -16,6 +16,7 @@ public class Migration extends MigrationProcessImpl {
@Override
@SneakyThrows
public void runDataMigration() {
initializeWorkflowHandler();
updateGovernanceWorkflowDefinitions();
updateDataInsightsApplication();
}