OpenMetadata/bootstrap/sql/migrations/native/1.9.2/postgres/postDataMigrationSQLScript.sql
Teddy d58b8a63d6
ISSUE #1753 - Add Row Count to Custom SQL Test (#22697)
* feat: add count rows support for custom SQL

* style: ran python linting

* feat: added logic for partitioned custom sql row count

* migration: partitionExpression parameter

* chore: resolve conflicts
2025-08-19 06:40:49 +02:00

22 lines
767 B
SQL

UPDATE test_definition
SET json = jsonb_set(json, '{supportsRowLevelPassedFailed}', 'true'::jsonb)
WHERE json->>'name' = 'tableCustomSQLQuery';
UPDATE test_definition
SET json = jsonb_set(
json,
'{parameterDefinition}',
(json->'parameterDefinition') || jsonb_build_object(
'name', 'partitionExpression',
'displayName', 'Partition Expression',
'description', 'Partition expression that will be used to compute the passed/failed row count, if compute row count is enabled.',
'dataType', 'STRING',
'required', false
)
)
WHERE json->>'name' = 'tableCustomSQLQuery'
AND NOT EXISTS (
SELECT 1
FROM jsonb_array_elements(json->'parameterDefinition') AS elem
WHERE elem->>'name' = 'partitionExpression'
);