File tree Expand file tree Collapse file tree 2 files changed +58
-0
lines changed
mastering-carol/sql-pipelines Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change
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
+
Original file line number Diff line number Diff line change 27
27
]
28
28
}
29
29
},
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
+ },
30
53
{
31
54
"useBatchNotification" : true ,
32
55
"pipelineName" : " organization_pipeline" ,
You can’t perform that action at this time.
0 commit comments