-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from fivetran/customer/add-project-id
Customer/add project
- Loading branch information
Showing
12 changed files
with
83 additions
and
47 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
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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 |
---|---|---|
@@ -1,57 +1,60 @@ | ||
with task_project as ( | ||
|
||
select * | ||
select * | ||
from {{ var('project_task') }} | ||
|
||
), | ||
|
||
project as ( | ||
select * | ||
|
||
select * | ||
from {{ var ('project') }} | ||
), | ||
|
||
task_section as ( | ||
|
||
select * | ||
select * | ||
from {{ var('task_section') }} | ||
|
||
), | ||
|
||
section as ( | ||
select * | ||
|
||
select * | ||
from {{ var ('section') }} | ||
|
||
), | ||
|
||
task_project_section as ( | ||
|
||
select | ||
select | ||
task_project.task_id, | ||
project.project_name || (case when section.section_name = '(no section)' then '' | ||
else ': ' || section.section_name end) as project_section, | ||
project.project_id | ||
else ': ' || section.section_name end) as project_section, | ||
cast(project.project_id as {{ dbt.type_string() }}) as project_id, | ||
project.project_name | ||
from | ||
task_project | ||
join project | ||
task_project | ||
join project | ||
on project.project_id = task_project.project_id | ||
join task_section | ||
on task_section.task_id = task_project.task_id | ||
join section | ||
on section.section_id = task_section.section_id | ||
join section | ||
on section.section_id = task_section.section_id | ||
and section.project_id = project.project_id | ||
), | ||
|
||
agg_project_sections as ( | ||
select | ||
select | ||
task_id, | ||
{{ fivetran_utils.string_agg( 'task_project_section.project_section', "', '" )}} as projects_sections, | ||
{{ fivetran_utils.string_agg( 'task_project_section.project_id', "', '" )}} as project_ids, | ||
{{ fivetran_utils.string_agg( 'task_project_section.project_name', "', '" )}} as project_names, | ||
count(project_id) as number_of_projects | ||
|
||
from task_project_section | ||
from task_project_section | ||
|
||
group by 1 | ||
) | ||
|
||
select * from agg_project_sections | ||
select * from agg_project_sections |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
packages: | ||
- package: fivetran/asana_source | ||
version: [">=0.8.0", "<0.9.0"] | ||
- package: fivetran/asana_source | ||
version: [">=0.8.0", "<0.9.0"] |