Recipe prompt
What you’ll build
A view that answers questions such as “who currently works at companies in this industry”. The person feed holds each person’s roles. The organization feed holds the company. You flatten the roles and join on company domain.Each feed row carries the record in its
serialized_data property. See the feed schema. The docs do not state the table names, the column type of serialized_data, or the schema name in Snowflake.Steps
1
Get the feeds into your account
Request delivery as described in Snowflake data share delivery. The Marketplace listings are covered separately in Forager on Snowflake Marketplace. The queries below use
PERSON_FEED and ORGANIZATION_FEED as stand-in table names. Replace them with the names in your share.2
Flatten each person's roles
A PersonProfile record has a
roles array. Each role has role_title, start_date, end_date, organization_id, organization_name and organization_domain. The feed has no is_current field, so treat a role with no end_date as current.3
Join to the organization feed
A Forager Organization Data record has
forager_id, name, domain, industry, employees_range, country and city. Match on the lowercase domain.4
Query it
organization_forager_id to the organization’s forager_id. Each job post also carries organization_domain.5
Keep it fresh
Person and organization records always have a
date_updated. On job posts it can be null. Filter on it when you build incremental tables, so you only reprocess rows that changed since your last run.Handle the edge cases
- Not found. A person whose roles have no
organization_domaindrops out of the join. Count them so you know how many. - Several current roles. A person with two open roles appears twice. Deduplicate on
person_idif you want one row per person. - Duplicate organizations. More than one organization row can share a domain. Check with
GROUP BY domain HAVING COUNT(*) > 1before you trust counts. - Domain formatting. Domains are compared in lowercase. Strip a scheme or a
www.prefix if either feed includes one. - API errors and credits. These queries run in Snowflake and do not call the REST API, so 403 and 429 do not apply. API requests use credits; see credit pricing and errors and rate limits.
Related
Data feed overview
Feeds, license and delivery options.
Feed schema
Every field of the three feeds.
Snowflake delivery
Request and access the share.
Role fields
The roles array in the person feed.