Moved Delta Migrations to schemaChanges.sql (#16789)

This commit is contained in:
IceS2 2024-06-28 17:40:41 +02:00 committed by GitHub
parent 0f2d3653f8
commit 927bf56738
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 31 additions and 33 deletions

View File

@ -23,23 +23,3 @@ WHERE name IN (
'columnValuesToBeBetween',
'tableRowCountToBeBetween'
);
-- Update DeltaLake service due to connection schema changes to enable DeltaLake ingestion from Storage
UPDATE dbservice_entity dbse
SET
dbse.json = JSON_REMOVE(JSON_REMOVE(
JSON_MERGE_PATCH(
dbse.json,
JSON_OBJECT(
'connection', JSON_OBJECT(
'config', JSON_OBJECT(
'configSource', JSON_OBJECT(
'connection', JSON_EXTRACT(dbse.json, '$.connection.config.metastoreConnection'),
'appName', JSON_UNQUOTE(JSON_EXTRACT(dbse.json, '$.connection.config.appName'))
)
)
)
)
)
, '$.connection.config.appName'), '$.connection.config.metastoreConnection')
WHERE dbse.serviceType = 'DeltaLake';

View File

@ -0,0 +1,19 @@
-- Update DeltaLake service due to connection schema changes to enable DeltaLake ingestion from Storage
UPDATE dbservice_entity dbse
SET
dbse.json = JSON_REMOVE(JSON_REMOVE(
JSON_MERGE_PATCH(
dbse.json,
JSON_OBJECT(
'connection', JSON_OBJECT(
'config', JSON_OBJECT(
'configSource', JSON_OBJECT(
'connection', JSON_EXTRACT(dbse.json, '$.connection.config.metastoreConnection'),
'appName', JSON_UNQUOTE(JSON_EXTRACT(dbse.json, '$.connection.config.appName'))
)
)
)
)
)
, '$.connection.config.appName'), '$.connection.config.metastoreConnection')
WHERE dbse.serviceType = 'DeltaLake';

View File

@ -22,16 +22,3 @@ WHERE name IN (
'columnValuesToBeBetween',
'tableRowCountToBeBetween'
);
-- Update DeltaLake service due to connection schema changes to enable DeltaLake ingestion from Storage
UPDATE dbservice_entity
SET json = JSONB_SET(
JSONB_SET(
json,
'{connection,config,configSource}',
JSONB_BUILD_OBJECT('connection', json->'connection'->'config'->'metastoreConnection')
),
'{connection,config,configSource,appName}',
json->'connection'->'config'->'appName'
) #- '{connection,config,metastoreConnection}' #- '{connection,config,appName}'
WHERE serviceType = 'DeltaLake';

View File

@ -0,0 +1,12 @@
-- Update DeltaLake service due to connection schema changes to enable DeltaLake ingestion from Storage
UPDATE dbservice_entity
SET json = JSONB_SET(
JSONB_SET(
json,
'{connection,config,configSource}',
JSONB_BUILD_OBJECT('connection', json->'connection'->'config'->'metastoreConnection')
),
'{connection,config,configSource,appName}',
json->'connection'->'config'->'appName'
) #- '{connection,config,metastoreConnection}' #- '{connection,config,appName}'
WHERE serviceType = 'DeltaLake';