Skip to content

Commit

Permalink
Demo carol.
Browse files Browse the repository at this point in the history
  • Loading branch information
poffo committed Feb 21, 2024
1 parent 7c54121 commit 6c0a09b
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
29 changes: 29 additions & 0 deletions mastering-carol/sql-pipelines/pipe-demo.csql
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
WITH organization_organization AS (
SELECT
null AS uuid,
null AS name,
null AS alias,
null AS federalid
--metadata--
FROM (
SELECT * EXCEPT(ranking)
FROM (
SELECT ROW_NUMBER() OVER (partition BY mdmId ORDER BY mdmCounterForEntity DESC) ranking, *
FROM stg_protheus_carol_organization
--timestamp-- WHERE mdmCounterForEntity__DATETIME__ > SAFE.DATETIME(TIMESTAMP_MICROS(SAFE_CAST({{start_from}} AS INT64)))
)
WHERE ranking = 1
) AS stg
),
combinedSources AS (
SELECT * FROM organization_organization
),
processedData AS (
SELECT *
FROM combinedSources
-- WHERE
-- rejection rules
)

SELECT * FROM processedData

23 changes: 23 additions & 0 deletions mastering-carol/sql-pipelines/pipelines.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,29 @@
]
}
},
{
"useBatchNotification": true,
"pipelineName": "pipedemo",
"pipelineDescription": "Pipeline de teste criado durante demo Carol.",
"outputDataModelName": "organization",
"overlapDeltaMinutes": 60,
"saveToCds": false,
"saveToUnified": true,
"sendToSubscriptions": true,
"cronExpressions": ["0 0 * * * ?"],
"timeZone": "America/Sao_Paulo",
"prepareScripts": [""],
"processScript": "pipe-demo.csql",
"sourceEntities": {
"dataModels": [],
"stagings": [
{
"connectorName": "protheus_carol",
"stagingName": "sa2"
}
]
}
},
{
"useBatchNotification": true,
"pipelineName": "organization_pipeline",
Expand Down

0 comments on commit 6c0a09b

Please sign in to comment.