Skip to content

Commit

Permalink
Use CSET, not airtable ids, in groups
Browse files Browse the repository at this point in the history
  • Loading branch information
jmelot committed May 16, 2024
1 parent fcfdbd3 commit cf91198
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"schema_name": "organizations",
"merge_query": "default_merge",
"production_table": "organizations",
"include_airtable_id": true,
"column_map": {
"Organization": "EXCLUDE",
"Name": "name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"airtable_table": "Groups",
"airtable_base": "appqtfVHf5tIRsfkI",
"schema_name": "groups",
"merge_query": "default_merge",
"merge_query": "groups_merge",
"production_table": "groups",
"column_map": {
"Group": "name",
Expand Down
10 changes: 10 additions & 0 deletions company_linkage/airtable_queries/groups_merge.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SELECT
{{ params.staging_table_name }}.name,
organizations.CSET_id
FROM
{{ params.staging_dataset }}.{{ params.staging_table_name }}
LEFT JOIN
UNNEST(CSET_ids) AS airtable_cset_id
LEFT JOIN
`{{ params.staging_dataset }}.000_main_raw` as organizations
ON organizations.airtable_id = airtable_cset_id
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
"name": "CSET_id",
"type": "INTEGER"
},
{
"description": "Airtable's identifier for the organization",
"mode": "NULLABLE",
"name": "airtable_id",
"type": "STRING"
},
{
"description": "Country where the organization is located",
"mode": "NULLABLE",
Expand Down

0 comments on commit cf91198

Please sign in to comment.