Skip to content

Instantly share code, notes, and snippets.

@danthelion
Created June 19, 2022 10:46
Show Gist options
  • Save danthelion/69a9e67950097a40f4ebf9cc7a45410e to your computer and use it in GitHub Desktop.
Save danthelion/69a9e67950097a40f4ebf9cc7a45410e to your computer and use it in GitHub Desktop.
Staging model for Find My Items
{{
config(
materialized='table'
)
}}
with raw as (
select
name as name,
timestamp as ts,
location ->> 'latitude' as latitude,
location ->> 'longitude' as longitude,
location ->> 'altitude' as altitude,
role ->> 'emoji' as emoji
from {{ source('tap_findmy', 'item') }}
)
select
latitude::float,
longitude::float,
altitude::float,
ts,
emoji,
name
from raw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment