-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters