OpenMetadata/bootstrap/sql/migrations/native/1.9.8/mysql/postDataMigrationSQLScript.sql
Teddy 1ef191a2aa
ISSUE #1534 - Profiler Refactor for Metadata Extraction Application (#23200)
* feat: added exporter app config

* refactor: added entityprofile resource & added backward compatibility to existing API

* feat: added tests to get_profile_data_by_type

* feat: remove non supported event types

* chore: added migrations to 1.9.7

* chore: added application creation readme

* chore: move migrations to 1.9.8

* fix: failing java test

* style: ran java linting
2025-09-05 13:07:04 +02:00

24 lines
724 B
SQL

-- Migrate individual profile data to EntityProfile format
UPDATE profiler_data_time_series pdts
INNER JOIN table_entity te ON (
pdts.entityFQNHash = te.fqnHash OR
pdts.entityFQNHash LIKE CONCAT(te.fqnHash, '.%')
)
SET pdts.json = JSON_OBJECT(
'id', UUID(),
'entityReference', JSON_OBJECT(
'id', te.json -> '$.id',
'type', 'table',
'fullyQualifiedName', te.json -> '$.fullyQualifiedName',
'name', te.name
),
'timestamp', pdts.timestamp,
'profileData', pdts.json,
'profileType',
(CASE pdts.extension
WHEN 'table.tableProfile' THEN 'table'
WHEN 'table.columnProfile' THEN 'column'
WHEN 'table.systemProfile' THEN 'system'
END)
);