visch
04/13/2025, 8:14 PMWITH json_messages AS (
SELECT payload::jsonb AS payload_json
FROM tap_gmail.messages
), parsed as (
SELECT
header ->> 'value' AS sender
FROM json_messages,
jsonb_array_elements(payload_json -> 'headers') AS header
WHERE header ->> 'name' = 'From'
)
select sender, count(*)
from parsed
group by sender
order by count(*) desc
- name: tap-gmail
namespace: tap_gmail
pip_url: git+<https://github.com/AutoIDM/tap-gmail.git>
executable: tap-gmail
capabilities:
- state
- catalog
- discover
settings:
- name: oauth_credentials.client_id
- name: oauth_credentials.client_secret
- name: oauth_credentials.refresh_token
- name: user_id
- name: messages.q
config:
messages.q: label:inbox
select:
- message_list.*
- messages.*
No easy way to group Google Inboxes by Sender
Here's some output as I was trying to 0 out my inbox that I was behind on
Google Voice <voice-noreply@google.com> 51
Smart Plugin Manager <smart.plugin.manager@wpengine.com> 24
The Google Workspace Team <workspace-noreply@google.com> 20
HubSpot <noreply@notifications.hubspot.com> 19
Stripe <notifications@stripe.com> 18