forked from fivetran/dbt_greenhouse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
greenhouse__interview_enhanced.sql
53 lines (42 loc) · 1.34 KB
/
greenhouse__interview_enhanced.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
with interview as (
select *
from {{ ref('int_greenhouse__interview_users') }}
),
job_stage as (
select *
from {{ var('job_stage') }}
),
-- this has job info!
application as (
select *
from {{ ref('int_greenhouse__application_info') }}
),
final as (
select
interview.*,
application.full_name as candidate_name,
job_stage.stage_name as job_stage,
application.current_job_stage as application_current_job_stage,
application.status as current_application_status,
application.job_title,
application.job_offices,
application.job_departments,
application.job_parent_departments,
application.job_id,
application.hiring_managers like ('%' || interview.interviewer_name || '%') as interviewer_is_hiring_manager,
application.hiring_managers,
application.recruiter_name
{% if var('greenhouse_using_eeoc', true) %}
,
application.candidate_gender,
application.candidate_disability_status,
application.candidate_race,
application.candidate_veteran_status
{% endif %}
from interview
left join job_stage
on interview.job_stage_id = job_stage.job_stage_id
left join
application on interview.application_id = application.application_id
)
select * from final