Skip to content

Commit

Permalink
adjusts column summary query
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosCoelhoSL committed Oct 8, 2024
1 parent 4fea210 commit a8db437
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/middleware/datasetOverview.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,26 @@ import { fetchResourceStatus } from './datasetTaskList.middleware.js'
import performanceDbApi from '../services/performanceDbApi.js'

const fetchColumnSummary = fetchMany({
query: ({ params }) => `select * from endpoint_dataset_resource_summary
where resource != ''
and endpoint_end_date = ''
and pipeline = '${params.dataset}'
query: ({ params }) => `
SELECT
edrs.*
FROM
endpoint_dataset_resource_summary edrs
INNER JOIN (
SELECT
endpoint,
dataset,
organisation,
end_date as endpoint_end_date
FROM
endpoint_dataset_summary
WHERE
end_date = ''
) as t1 on t1.endpoint = edrs.endpoint
AND replace(t1.organisation, '-eng', '') = edrs.organisation
WHERE
edrs.resource != ''
AND pipeline = '${params.dataset}'
AND organisation = '${params.lpa}'
limit 1000`,
result: 'columnSummary',
Expand Down

0 comments on commit a8db437

Please sign in to comment.