Skip to content

Commit a741aea

Browse files
committed
Test demo.
1 parent 412ce39 commit a741aea

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
WITH organization_apinvoice AS (
2+
SELECT
3+
null AS _orgid,
4+
null AS businesspartner_id,
5+
null AS docreference,
6+
null AS invoice_id,
7+
null AS docissue,
8+
null AS erp_id,
9+
null AS protheus_id,
10+
null AS transactiontype,
11+
null AS deleted,
12+
null AS installmentqty
13+
--metadata--
14+
FROM (
15+
SELECT * EXCEPT(ranking)
16+
FROM (
17+
SELECT ROW_NUMBER() OVER (partition BY mdmId ORDER BY mdmCounterForEntity DESC) ranking, *
18+
FROM stg_protheus_carol_organization
19+
--timestamp-- WHERE mdmCounterForEntity__DATETIME__ > SAFE.DATETIME(TIMESTAMP_MICROS(SAFE_CAST({{start_from}} AS INT64)))
20+
)
21+
WHERE ranking = 1
22+
) AS stg
23+
),
24+
combinedSources AS (
25+
SELECT * FROM organization_apinvoice
26+
),
27+
processedData AS (
28+
SELECT *
29+
FROM combinedSources
30+
-- WHERE
31+
-- rejection rules
32+
)
33+
34+
SELECT * FROM processedData
35+

mastering-carol/sql-pipelines/pipelines.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,29 @@
2727
]
2828
}
2929
},
30+
{
31+
"useBatchNotification": true,
32+
"pipelineName": "pipedemo",
33+
"pipelineDescription": "Pipeline durante demo Carol",
34+
"outputDataModelName": "organization",
35+
"overlapDeltaMinutes": 60,
36+
"saveToCds": false,
37+
"saveToUnified": true,
38+
"sendToSubscriptions": true,
39+
"cronExpressions": ["0 0 * * * ?"],
40+
"timeZone": "America/Sao_Paulo",
41+
"prepareScripts": [""],
42+
"processScript": "pipedemo.csql",
43+
"sourceEntities": {
44+
"dataModels": [],
45+
"stagings": [
46+
{
47+
"connectorName": "protheus_carol",
48+
"stagingName": "sa2"
49+
}
50+
]
51+
}
52+
},
3053
{
3154
"useBatchNotification": true,
3255
"pipelineName": "organization_pipeline",

0 commit comments

Comments
 (0)