AN-5408/new-farcaster-views (#82)

This commit is contained in:
drethereum 2024-11-04 10:24:56 -07:00 committed by GitHub
parent f0ea8c7d22
commit 3e1caf053d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 90 additions and 0 deletions

View File

@ -90,6 +90,8 @@ Note: These tables ceased updating on Feburary 4th, 2024.
- [dim_fids](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__dim_fids)
- [dim_fnames](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__dim_fnames)
- [dim_profile_with_addresses](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__dim_profile_with_addresses)
- [fact_blocks](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__fact_blocks)
- [fact_channel_follows](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__fact_channel_follows)
- [fact_casts](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__fact_casts)
- [fact_links](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__fact_links)
- [fact_reactions](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__fact_reactions)

View File

@ -0,0 +1,22 @@
{{ config(
materialized = 'view',
persist_docs ={ "relation": true,
"columns": true },
tags = ['farcaster'],
meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'FARCASTER' } } }
) }}
SELECT
blocker_fid,
blocked_fid,
id,
created_at,
deleted_at
FROM
{{ source(
'external_bronze',
'farcaster_blocks'
) }}
qualify(ROW_NUMBER() over (PARTITION BY id
ORDER BY
created_at DESC)) = 1

View File

@ -0,0 +1,18 @@
version: 2
models:
- name: farcaster__fact_blocks
description: Represents users that have blocked or been blocked. For more info see [Neynar](https://docs.neynar.com/docs/how-to-query-neynar-sql-playground-for-farcaster-data) or [schema](https://github.com/farcasterxyz/hub-monorepo/tree/51c57245df8ec1c68d616dd3ab8ae5b80edf68fd/apps/replicator)
columns:
- name: BLOCKER_FID
description: The FID of the user that blocked the other user.
- name: BLOCKED_FID
description: The FID of the user that has been blocked.
- name: ID
description: Generic identifier specific to this DB (a.k.a. surrogate key)
- name: CREATED_AT
description: When the row was first created in this DB (not the same as the message timestamp!)
tests:
- not_null
- name: DELETED_AT
description: When the cast was considered deleted/revoked/pruned by the hub (e.g. in response to a CastRemove message, etc.)

View File

@ -0,0 +1,24 @@
{{ config(
materialized = 'view',
persist_docs ={ "relation": true,
"columns": true },
tags = ['farcaster'],
meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'FARCASTER' } } }
) }}
SELECT
TIMESTAMP,
fid,
channel_id,
id,
created_at,
updated_at,
deleted_at
FROM
{{ source(
'external_bronze',
'farcaster_channel_follows'
) }}
qualify(ROW_NUMBER() over (PARTITION BY id
ORDER BY
updated_at DESC)) = 1

View File

@ -0,0 +1,22 @@
version: 2
models:
- name: farcaster__fact_channel_follows
description: Represents follows for a Farcaster channel. For more info see [Neynar](https://docs.neynar.com/docs/how-to-query-neynar-sql-playground-for-farcaster-data) or [schema](https://github.com/farcasterxyz/hub-monorepo/tree/51c57245df8ec1c68d616dd3ab8ae5b80edf68fd/apps/replicator)
columns:
- name: CHANNEL_ID
description: Unique identifier for the channel.
- name: TIMESTAMP
description: Message timestamp in UTC.
- name: FID
description: FID of the user that signed the message.
- name: ID
description: Generic identifier specific to this DB (a.k.a. surrogate key)
- name: CREATED_AT
description: When the row was first created in this DB (not the same as the message timestamp!)
- name: UPDATED_AT
description: When the row was last updated.
tests:
- not_null
- name: DELETED_AT
description: When the cast was considered deleted/revoked/pruned by the hub (e.g. in response to a CastRemove message, etc.)

View File

@ -75,6 +75,7 @@ sources:
database: external
schema: bronze
tables:
- name: farcaster_blocks
- name: farcaster_casts
- name: farcaster_fids
- name: farcaster_fnames
@ -84,5 +85,6 @@ sources:
- name: farcaster_reactions
- name: farcaster_user_data
- name: farcaster_verifications
- name: farcaster_channel_follows
- name: farcaster_profile_with_addresses
- name: farcaster_warpcast_power_users