%3 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced->1. model.amplitude.amplitude__daily_performance 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced 2. model.amplitude.amplitude__event_enhanced->4. model.amplitude.amplitude__user_enhanced 5. model.amplitude.int_amplitude__date_spine 5. model.amplitude.int_amplitude__date_spine 2. model.amplitude.amplitude__event_enhanced->5. model.amplitude.int_amplitude__date_spine 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions->2. model.amplitude.amplitude__event_enhanced 3. model.amplitude.amplitude__sessions->4. model.amplitude.amplitude__user_enhanced 5. model.amplitude.int_amplitude__date_spine->1. model.amplitude.amplitude__daily_performance 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event->2. model.amplitude.amplitude__event_enhanced 6. model.amplitude_source.stg_amplitude__event->3. model.amplitude.amplitude__sessions 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp->6. model.amplitude_source.stg_amplitude__event 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type->2. model.amplitude.amplitude__event_enhanced 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp->8. model.amplitude_source.stg_amplitude__event_type 10. source.amplitude_source.amplitude.event 10. source.amplitude_source.amplitude.event 10. source.amplitude_source.amplitude.event->7. model.amplitude_source.stg_amplitude__event_tmp 11. source.amplitude_source.amplitude.event_type 11. source.amplitude_source.amplitude.event_type 11. source.amplitude_source.amplitude.event_type->9. model.amplitude_source.stg_amplitude__event_type_tmp
1. model.amplitude.amplitude__daily_performance

This SQL query creates a daily performance report for Amplitude events. It starts by joining event data with a date spine to ensure all dates are represented. It then aggregates event data to calculate daily counts of events, sessions, users, and new users for each event type. Finally, it combines this information, fills in any missing values with zeros, and generates a unique key for each daily record.

IntegrationAggregationFeaturizationCleaning
SQL Query
WITH event_enhanced AS (
  SELECT
    *
  FROM TEST.PUBLIC_amplitude.amplitude__event_enhanced
), date_spine AS (
  SELECT
    spine.*
  FROM TEST.PUBLIC_int_amplitude.int_amplitude__date_spine AS spine
), agg_event_data AS (
  SELECT
    event_day,
    event_type,
    COUNT(DISTINCT unique_event_id) AS number_events,
    COUNT(DISTINCT unique_session_id) AS number_sessions,
    COUNT(DISTINCT amplitude_user_id) AS number_users,
    COUNT(
      DISTINCT (
        CASE
          WHEN CAST(DATE_TRUNC('DAY', user_creation_time) AS DATE) = event_day
          THEN amplitude_user_id
        END
      )
    ) AS number_new_users
  FROM event_enhanced
  GROUP BY
    1,
    2
), spine_joined AS (
  SELECT
    date_spine.event_day,
    date_spine.event_type,
    agg_event_data.number_events,
    agg_event_data.number_sessions,
    agg_event_data.number_users,
    agg_event_data.number_new_users
  FROM date_spine
  LEFT JOIN agg_event_data
    ON date_spine.event_day = agg_event_data.event_day
    AND date_spine.event_type = agg_event_data.event_type
), final AS (
  SELECT
    event_day,
    event_type,
    COALESCE(number_events, 0) AS number_events,
    COALESCE(number_sessions, 0) AS number_sessions,
    COALESCE(number_users, 0) AS number_users,
    COALESCE(number_new_users, 0) AS number_new_users,
    MD5(
      CAST(COALESCE(CAST(event_day AS TEXT), '_dbt_utils_surrogate_key_null_') || '-' || COALESCE(CAST(event_type AS TEXT), '_dbt_utils_surrogate_key_null_') AS TEXT)
    ) AS daily_unique_key
  FROM spine_joined
)
SELECT
  *
FROM final
%3 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance event_day event_type number_events number_sessions number_users number_new_users daily_unique_key 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced unique_event_id unique_session_id amplitude_user_id event_type event_day client_event_time user_creation_time user_id event_type_name 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f2 2. model.amplitude.amplitude__event_enhanced:f1->1. model.amplitude.amplitude__daily_performance:f3 2. model.amplitude.amplitude__event_enhanced:f2->1. model.amplitude.amplitude__daily_performance:f4 2. model.amplitude.amplitude__event_enhanced:f2->1. model.amplitude.amplitude__daily_performance:f5 2. model.amplitude.amplitude__event_enhanced:f3->1. model.amplitude.amplitude__daily_performance:f1 2. model.amplitude.amplitude__event_enhanced:f4->1. model.amplitude.amplitude__daily_performance:f0 2. model.amplitude.amplitude__event_enhanced:f5->1. model.amplitude.amplitude__daily_performance:f0 2. model.amplitude.amplitude__event_enhanced:f6->1. model.amplitude.amplitude__daily_performance:f5 2. model.amplitude.amplitude__event_enhanced:f7->1. model.amplitude.amplitude__daily_performance:f4 2. model.amplitude.amplitude__event_enhanced:f7->1. model.amplitude.amplitude__daily_performance:f5 2. model.amplitude.amplitude__event_enhanced:f8->1. model.amplitude.amplitude__daily_performance:f1 5. model.amplitude.int_amplitude__date_spine 5. model.amplitude.int_amplitude__date_spine event_type event_day 5. model.amplitude.int_amplitude__date_spine:f0->1. model.amplitude.amplitude__daily_performance:f1 5. model.amplitude.int_amplitude__date_spine:f1->1. model.amplitude.amplitude__daily_performance:f0
Name Type Comment
event_day date Day of event time
event_type text The assigned type of event. Example 'Add Friend'
number_events bigint Count of distinct events
number_sessions bigint Count of distinct sessions
number_users bigint Count of distinct visitors
number_new_users bigint Count of distinct new visitors for that day
daily_unique_key text None
Column Lineage
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced client_event_time event_day 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance event_day 2. model.amplitude.amplitude__event_enhanced:f1->1. model.amplitude.amplitude__daily_performance:f0 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 5. model.amplitude.int_amplitude__date_spine 5. model.amplitude.int_amplitude__date_spine event_day 2. model.amplitude.amplitude__event_enhanced:f1->5. model.amplitude.int_amplitude__date_spine:f0 5. model.amplitude.int_amplitude__date_spine:f0->1. model.amplitude.amplitude__daily_performance:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_event_time event_day event_time unique_event_id 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_event_time event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f3
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create event_day
    • Filtering Used to filter records based on date range
    • Output Columns:
      • event_time: Directly copied after casting
      • event_day: Derived from event_time
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create unique_event_id
    • Output Columns:
      • client_event_time: Directly copied after casting to TIMESTAMP
      • unique_event_id: Part of the MD5 hash to create this column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_day]
    • Direct The column is directly copied without any transformation
    • Other Used in the unique_key generation
    • Output Columns:
      • event_day: Directly copied
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_event_time]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Output Columns:
      • client_event_time: Directly copied
5. model.amplitude.int_amplitude__date_spine
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_day]
    • Integration Used to join with the spine CTE to ensure each event_type has a record for every day since their first day
    • Featurization Used to create the event_day column in the output
    • Output Columns:
      • event_day: Transformed from the spine.date_day and used as the output column
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_day]
    • Direct Copied directly to the output
    • Aggregation Used as a grouping column in the aggregation
    • Integration Used to join with the date_spine table
    • Output Columns:
      • event_day: Directly copied to the output
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[client_event_time]
    • Aggregation Used to determine the event day for grouping
    • Output Columns:
      • event_day: Derived from DATE_TRUNC('DAY', client_event_time)
  • Input Column: 5. model.amplitude.int_amplitude__date_spine[event_day]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the agg_event_data CTE
    • Aggregation The column is grouped by in the agg_event_data CTE
    • Output Columns:
      • event_day: Directly mapped to the output column
Column Lineage
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_type event_type_name 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance event_type 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 2. model.amplitude.amplitude__event_enhanced:f1->1. model.amplitude.amplitude__daily_performance:f0 5. model.amplitude.int_amplitude__date_spine 5. model.amplitude.int_amplitude__date_spine event_type 2. model.amplitude.amplitude__event_enhanced:f0->5. model.amplitude.int_amplitude__date_spine:f0 2. model.amplitude.amplitude__event_enhanced:f1->5. model.amplitude.int_amplitude__date_spine:f0 5. model.amplitude.int_amplitude__date_spine:f0->1. model.amplitude.amplitude__daily_performance:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_type 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type event_type_name 8. model.amplitude_source.stg_amplitude__event_type:f0->2. model.amplitude.amplitude__event_enhanced:f1 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_type 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp name 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • event_type: Directly copied
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • event_type_name: Directly mapped to this output column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_type]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with event_type table
    • Output Columns:
      • event_type: Directly copied
  • Input Column: 8. model.amplitude_source.stg_amplitude__event_type[event_type_name]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with event_data
    • Output Columns:
      • event_type_name: Directly mapped
5. model.amplitude.int_amplitude__date_spine
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_type]
    • Direct The event_type is directly selected from the event_data CTE
    • Integration Used to join with the spine CTE to create a record for each event type on every day
    • Output Columns:
      • event_type: Directly mapped to the output column
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_type_name]
    • Integration Used to join with the spine table to create records for each event type
    • Output Columns:
      • event_type: Likely mapped directly to this output column
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_type]
    • Direct Copied directly to the output
    • Aggregation Used as a grouping column in the aggregation
    • Integration Used to join with the date_spine table
    • Output Columns:
      • event_type: Directly copied to the output
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_type_name]
    • Aggregation Grouped by in the agg_event_data CTE
    • Integration Used to join with date_spine CTE
    • Output Columns:
      • event_type: Directly mapped to this output column
  • Input Column: 5. model.amplitude.int_amplitude__date_spine[event_type]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the agg_event_data CTE
    • Aggregation The column is grouped by in the agg_event_data CTE
    • Output Columns:
      • event_type: Directly mapped to the output column
Column Lineage
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced unique_event_id 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_events 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_event_time device_id unique_event_id 6. model.amplitude_source.stg_amplitude__event:f2->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_event_time device_id 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f2
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Other Used in the MD5 hash to create unique_event_id
    • Output Columns:
      • device_id: Directly mapped
      • unique_event_id: Part of the MD5 hash
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create unique_event_id
    • Output Columns:
      • client_event_time: Directly copied after casting to TIMESTAMP
      • unique_event_id: Part of the MD5 hash to create this column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_event_id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Output Columns:
      • unique_event_id: Directly copied
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_event_id]
    • Aggregation Used in COUNT(DISTINCT unique_event_id) to calculate number_events
    • Output Columns:
      • number_events: Aggregated to count distinct events
Column Lineage
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_event_number session_id unique_session_id user_id 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_sessions 2. model.amplitude.amplitude__event_enhanced:f2->1. model.amplitude.amplitude__daily_performance:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions unique_session_id user_id 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event amplitude_user_id session_id unique_session_id user_id 6. model.amplitude_source.stg_amplitude__event:f2->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f0 6. model.amplitude_source.stg_amplitude__event:f3->2. model.amplitude.amplitude__event_enhanced:f3 6. model.amplitude_source.stg_amplitude__event:f3->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f3->3. model.amplitude.amplitude__sessions:f1 6. model.amplitude_source.stg_amplitude__event:f3->3. model.amplitude.amplitude__sessions:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp session_id user_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f0
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_session_id]
    • Direct Directly used in the output
    • Aggregation Used as a grouping key
    • Output Columns:
      • unique_session_id: Directly copied
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[session_id]
    • Integration Used to create the unique_session_id by concatenating with user_id
    • Output Columns:
      • unique_session_id: Concatenated with user_id to form unique_session_id
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_id]
    • Direct Copied without transformation
    • Integration Used to create the unique_session_id by concatenating with session_id
    • Aggregation Used in GROUP BY clause for session aggregation
    • Deduplication Used in window functions for session ranking and lag calculations
    • Output Columns:
      • user_id: Directly copied
      • unique_session_id: Concatenated with session_id to form unique_session_id
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[session_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Other Used in creating the unique_session_id
    • Output Columns:
      • session_id: Directly mapped
      • unique_session_id: Part of MD5 hash with user_id
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[session_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Other Used in creating the unique_session_id
    • Output Columns:
      • session_id: Directly mapped
      • unique_session_id: Part of MD5 hash with user_id
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[unique_session_id]
    • Integration used as the key to join session_data with event_data
    • Direct directly copied to the output
    • Output Columns:
      • unique_session_id: directly copied
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_session_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the session_data CTE
    • Output Columns:
      • unique_session_id: Directly copied
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[session_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the unique_session_id
    • Deduplication Used in the ROW_NUMBER() function for session_event_number
    • Output Columns:
      • session_id: Directly copied
      • unique_session_id: Part of the concatenation
      • session_event_number: Used in the PARTITION BY clause
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_id]
    • Cleaning The column is cast as TEXT
    • Integration Used as part of the unique_session_id
    • Output Columns:
      • user_id: Cast as TEXT
      • unique_session_id: Part of the concatenation
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_session_id]
    • Aggregation Used in COUNT(DISTINCT unique_session_id) to calculate number_sessions
    • Output Columns:
      • number_sessions: Aggregated to count distinct sessions
Column Lineage
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced amplitude_user_id unique_session_id user_id 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_new_users number_users 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f1 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 2. model.amplitude.amplitude__event_enhanced:f2->1. model.amplitude.amplitude__daily_performance:f1 2. model.amplitude.amplitude__event_enhanced:f2->1. model.amplitude.amplitude__daily_performance:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event amplitude_id amplitude_user_id unique_session_id user_id 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f0 6. model.amplitude_source.stg_amplitude__event:f3->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event:f3->2. model.amplitude.amplitude__event_enhanced:f1 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp amplitude_id user_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[amplitude_id]
    • Cleaning The column is cast as TEXT
    • Other Used as a fallback for amplitude_user_id when user_id is null
    • Output Columns:
      • amplitude_id: Directly mapped after casting
      • amplitude_user_id: Used as fallback when user_id is null
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[amplitude_user_id]
    • Direct The column is directly copied without any transformation
    • Cleaning Cast as TEXT
    • Featurization Used to generate user_event_number
    • Output Columns:
      • amplitude_user_id: Directly copied after casting to TEXT
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_id]
    • Cleaning The column is cast as TEXT
    • Integration Used as part of the unique_session_id
    • Output Columns:
      • user_id: Cast as TEXT
      • unique_session_id: Part of the concatenation
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[amplitude_user_id]
    • Aggregation Used in COUNT(DISTINCT amplitude_user_id) to calculate number_users and number_new_users
    • Output Columns:
      • number_users: Aggregated to count distinct users
      • number_new_users: Aggregated to count distinct new users
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[user_id]
    • Aggregation Used as part of COUNT(DISTINCT amplitude_user_id) to calculate number_users
    • Featurization Used to determine new users based on user_creation_time
    • Output Columns:
      • number_users: Aggregated to count distinct users
      • number_new_users: Used to identify new users
Column Lineage
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced amplitude_user_id unique_session_id user_creation_time user_id 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_new_users number_users 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f1 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 2. model.amplitude.amplitude__event_enhanced:f2->1. model.amplitude.amplitude__daily_performance:f0 2. model.amplitude.amplitude__event_enhanced:f3->1. model.amplitude.amplitude__daily_performance:f1 2. model.amplitude.amplitude__event_enhanced:f3->1. model.amplitude.amplitude__daily_performance:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event amplitude_id amplitude_user_id unique_session_id user_creation_time user_id 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f0 6. model.amplitude_source.stg_amplitude__event:f3->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event:f4->2. model.amplitude.amplitude__event_enhanced:f3 6. model.amplitude_source.stg_amplitude__event:f4->2. model.amplitude.amplitude__event_enhanced:f1 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp amplitude_id user_creation_time user_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f2->6. model.amplitude_source.stg_amplitude__event:f4 7. model.amplitude_source.stg_amplitude__event_tmp:f2->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f2->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f2->6. model.amplitude_source.stg_amplitude__event:f4 7. model.amplitude_source.stg_amplitude__event_tmp:f2->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f2->6. model.amplitude_source.stg_amplitude__event:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[amplitude_id]
    • Cleaning The column is cast as TEXT
    • Other Used as a fallback for amplitude_user_id when user_id is null
    • Output Columns:
      • amplitude_id: Directly mapped after casting
      • amplitude_user_id: Used as fallback when user_id is null
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_creation_time]
    • Direct The column is directly copied
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • user_creation_time: Cast as TIMESTAMP and directly mapped
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[amplitude_user_id]
    • Direct The column is directly copied without any transformation
    • Cleaning Cast as TEXT
    • Featurization Used to generate user_event_number
    • Output Columns:
      • amplitude_user_id: Directly copied after casting to TEXT
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_creation_time]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • user_creation_time: Directly copied
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_id]
    • Cleaning The column is cast as TEXT
    • Integration Used as part of the unique_session_id
    • Output Columns:
      • user_id: Cast as TEXT
      • unique_session_id: Part of the concatenation
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[amplitude_user_id]
    • Aggregation Used in COUNT(DISTINCT amplitude_user_id) to calculate number_users and number_new_users
    • Output Columns:
      • number_users: Aggregated to count distinct users
      • number_new_users: Aggregated to count distinct new users
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[user_creation_time]
    • Featurization Used to determine if a user is new on a given day
    • Output Columns:
      • number_new_users: Contributes to the count of new users
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[user_id]
    • Aggregation Used as part of COUNT(DISTINCT amplitude_user_id) to calculate number_users
    • Featurization Used to determine new users based on user_creation_time
    • Output Columns:
      • number_users: Aggregated to count distinct users
      • number_new_users: Used to identify new users
2. model.amplitude.amplitude__event_enhanced

This SQL query combines and enhances event data from Amplitude. It deduplicates raw event data, joins it with event type and session data, and adds additional columns such as session and user event numbers. The query also incorporates various event and session-related metrics, and finally generates a unique key for each event.

DeduplicationIntegrationFeaturizationCleaning
SQL Query
WITH event_data_raw AS (
  SELECT
    events.*
  FROM TEST.PUBLIC__source_amplitude.stg_amplitude__event AS events
), event_data /* deduplicate */ AS (
  SELECT
    *
  FROM (
    SELECT
      *,
      CASE
        WHEN NOT _insert_id IS NULL
        THEN ROW_NUMBER() OVER (PARTITION BY _insert_id ORDER BY client_upload_time DESC)
        ELSE ROW_NUMBER() OVER (PARTITION BY event_id, device_id, client_event_time, amplitude_user_id ORDER BY client_upload_time DESC)
      END AS nth_event_record
    FROM event_data_raw
  ) AS duplicates
  WHERE
    nth_event_record = 1
), event_type AS (
  SELECT
    *
  FROM TEST.PUBLIC__source_amplitude.stg_amplitude__event_type
), session_data AS (
  SELECT
    *
  FROM TEST.PUBLIC_amplitude.amplitude__sessions
), event_enhanced AS (
  SELECT
    event_data.unique_event_id,
    event_data.unique_session_id,
    CAST(event_data.amplitude_user_id AS TEXT) AS amplitude_user_id,
    event_data.event_id,
    event_data.event_type,
    event_data.event_time,
    event_data.event_day,
    event_type.event_type_id,
    event_type.event_type_name,
    event_data.session_id,
    ROW_NUMBER() OVER (PARTITION BY session_id ORDER BY event_time ASC) AS session_event_number,
    ROW_NUMBER() OVER (PARTITION BY amplitude_user_id ORDER BY event_time ASC) AS user_event_number,
    event_data.group_types,
    CAST(event_data.user_id AS TEXT) AS user_id,
    event_data.user_creation_time,
    event_data.amplitude_id,
    event_data.app,
    event_data.project_name,
    event_data.version_name,
    event_data.client_event_time,
    event_data.client_upload_time,
    event_data.server_received_time,
    event_data.server_upload_time,
    event_data.city,
    event_data.country,
    event_data.region,
    event_data.data,
    event_data.location_lat,
    event_data.location_lng,
    event_data.device_brand,
    event_data.device_carrier,
    event_data.device_family,
    event_data.device_id,
    event_data.device_manufacturer,
    event_data.device_model,
    event_data.device_type,
    event_data.ip_address,
    event_data.os_name,
    event_data.os_version,
    event_data.platform,
    event_data.language,
    event_data.dma,
    event_data.schema,
    event_data.start_version,
    event_type.totals,
    event_type.value,
    session_data.events_per_session,
    session_data.session_started_at,
    session_data.session_ended_at,
    session_data.user_session_number,
    session_data.session_started_at_day,
    session_data.session_ended_at_day,
    session_data.session_length_in_minutes,
    session_data.is_first_user_session,
    session_data.minutes_in_between_sessions
  FROM event_data
  LEFT JOIN event_type
    ON event_data.event_type_id = event_type.event_type_id
  LEFT JOIN session_data
    ON event_data.unique_session_id = session_data.unique_session_id
), final AS (
  SELECT
    *,
    MD5(
      CAST(COALESCE(CAST(unique_event_id AS TEXT), '_dbt_utils_surrogate_key_null_') || '-' || COALESCE(CAST(event_day AS TEXT), '_dbt_utils_surrogate_key_null_') AS TEXT)
    ) AS unique_key
  FROM event_enhanced
)
SELECT
  *
FROM final
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced unique_event_id unique_session_id amplitude_user_id event_id event_type event_time event_day session_id amplitude_id app project_name version_name client_event_time client_upload_time server_received_time server_upload_time city country region data location_lat location_lng device_brand device_carrier device_family device_id device_manufacturer device_model device_type ip_address os_name os_version platform language dma schema start_version user_creation_time session_event_number group_types user_id event_type_id event_type_name totals value events_per_session session_started_at session_ended_at session_length is_first_user_session user_event_number user_session_number session_started_at_day session_ended_at_day session_length_in_minutes minutes_in_between_sessions unique_key 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions unique_session_id events_per_session session_started_at session_ended_at session_started_at_day session_ended_at_day user_session_number is_first_user_session minutes_in_between_sessions session_length_in_minutes 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f1 3. model.amplitude.amplitude__sessions:f1->2. model.amplitude.amplitude__event_enhanced:f45 3. model.amplitude.amplitude__sessions:f2->2. model.amplitude.amplitude__event_enhanced:f46 3. model.amplitude.amplitude__sessions:f3->2. model.amplitude.amplitude__event_enhanced:f47 3. model.amplitude.amplitude__sessions:f4->2. model.amplitude.amplitude__event_enhanced:f52 3. model.amplitude.amplitude__sessions:f5->2. model.amplitude.amplitude__event_enhanced:f53 3. model.amplitude.amplitude__sessions:f6->2. model.amplitude.amplitude__event_enhanced:f51 3. model.amplitude.amplitude__sessions:f7->2. model.amplitude.amplitude__event_enhanced:f49 3. model.amplitude.amplitude__sessions:f8->2. model.amplitude.amplitude__event_enhanced:f55 3. model.amplitude.amplitude__sessions:f9->2. model.amplitude.amplitude__event_enhanced:f54 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event unique_event_id event_id unique_session_id amplitude_id amplitude_user_id app city client_event_time client_upload_time country data device_brand device_carrier device_family device_id device_manufacturer device_model device_type dma event_time event_day event_type event_type_id group_types _insert_id ip_address language location_lat location_lng os_name os_version platform project_name region schema server_received_time server_upload_time session_id start_version user_creation_time user_id uuid version_name 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f3 6. model.amplitude_source.stg_amplitude__event:f2->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event:f3->2. model.amplitude.amplitude__event_enhanced:f8 6. model.amplitude_source.stg_amplitude__event:f4->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event:f5->2. model.amplitude.amplitude__event_enhanced:f9 6. model.amplitude_source.stg_amplitude__event:f6->2. model.amplitude.amplitude__event_enhanced:f16 6. model.amplitude_source.stg_amplitude__event:f7->2. model.amplitude.amplitude__event_enhanced:f12 6. model.amplitude_source.stg_amplitude__event:f8->2. model.amplitude.amplitude__event_enhanced:f13 6. model.amplitude_source.stg_amplitude__event:f9->2. model.amplitude.amplitude__event_enhanced:f17 6. model.amplitude_source.stg_amplitude__event:f10->2. model.amplitude.amplitude__event_enhanced:f19 6. model.amplitude_source.stg_amplitude__event:f11->2. model.amplitude.amplitude__event_enhanced:f22 6. model.amplitude_source.stg_amplitude__event:f12->2. model.amplitude.amplitude__event_enhanced:f23 6. model.amplitude_source.stg_amplitude__event:f13->2. model.amplitude.amplitude__event_enhanced:f24 6. model.amplitude_source.stg_amplitude__event:f14->2. model.amplitude.amplitude__event_enhanced:f25 6. model.amplitude_source.stg_amplitude__event:f15->2. model.amplitude.amplitude__event_enhanced:f26 6. model.amplitude_source.stg_amplitude__event:f16->2. model.amplitude.amplitude__event_enhanced:f27 6. model.amplitude_source.stg_amplitude__event:f17->2. model.amplitude.amplitude__event_enhanced:f28 6. model.amplitude_source.stg_amplitude__event:f18->2. model.amplitude.amplitude__event_enhanced:f34 6. model.amplitude_source.stg_amplitude__event:f19->2. model.amplitude.amplitude__event_enhanced:f5 6. model.amplitude_source.stg_amplitude__event:f20->2. model.amplitude.amplitude__event_enhanced:f6 6. model.amplitude_source.stg_amplitude__event:f21->2. model.amplitude.amplitude__event_enhanced:f4 6. model.amplitude_source.stg_amplitude__event:f22->2. model.amplitude.amplitude__event_enhanced:f41 6. model.amplitude_source.stg_amplitude__event:f23->2. model.amplitude.amplitude__event_enhanced:f39 6. model.amplitude_source.stg_amplitude__event:f25->2. model.amplitude.amplitude__event_enhanced:f29 6. model.amplitude_source.stg_amplitude__event:f26->2. model.amplitude.amplitude__event_enhanced:f33 6. model.amplitude_source.stg_amplitude__event:f27->2. model.amplitude.amplitude__event_enhanced:f20 6. model.amplitude_source.stg_amplitude__event:f28->2. model.amplitude.amplitude__event_enhanced:f21 6. model.amplitude_source.stg_amplitude__event:f29->2. model.amplitude.amplitude__event_enhanced:f30 6. model.amplitude_source.stg_amplitude__event:f30->2. model.amplitude.amplitude__event_enhanced:f31 6. model.amplitude_source.stg_amplitude__event:f31->2. model.amplitude.amplitude__event_enhanced:f32 6. model.amplitude_source.stg_amplitude__event:f32->2. model.amplitude.amplitude__event_enhanced:f10 6. model.amplitude_source.stg_amplitude__event:f33->2. model.amplitude.amplitude__event_enhanced:f18 6. model.amplitude_source.stg_amplitude__event:f34->2. model.amplitude.amplitude__event_enhanced:f35 6. model.amplitude_source.stg_amplitude__event:f35->2. model.amplitude.amplitude__event_enhanced:f14 6. model.amplitude_source.stg_amplitude__event:f36->2. model.amplitude.amplitude__event_enhanced:f15 6. model.amplitude_source.stg_amplitude__event:f37->2. model.amplitude.amplitude__event_enhanced:f7 6. model.amplitude_source.stg_amplitude__event:f37->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event:f37->2. model.amplitude.amplitude__event_enhanced:f38 6. model.amplitude_source.stg_amplitude__event:f38->2. model.amplitude.amplitude__event_enhanced:f36 6. model.amplitude_source.stg_amplitude__event:f39->2. model.amplitude.amplitude__event_enhanced:f37 6. model.amplitude_source.stg_amplitude__event:f40->2. model.amplitude.amplitude__event_enhanced:f40 6. model.amplitude_source.stg_amplitude__event:f40->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event:f42->2. model.amplitude.amplitude__event_enhanced:f11 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type event_type_id event_type_name totals value 8. model.amplitude_source.stg_amplitude__event_type:f0->2. model.amplitude.amplitude__event_enhanced:f41 8. model.amplitude_source.stg_amplitude__event_type:f1->2. model.amplitude.amplitude__event_enhanced:f42 8. model.amplitude_source.stg_amplitude__event_type:f2->2. model.amplitude.amplitude__event_enhanced:f43 8. model.amplitude_source.stg_amplitude__event_type:f3->2. model.amplitude.amplitude__event_enhanced:f44
Name Type Comment
unique_event_id text A unique key for each event, concatenating event_id, device_id, and client_event_time
unique_session_id text Unique key of each session, concatenating user_id and session_id
amplitude_user_id text Unique key for each user, which is user_id by default. If user_id does not exist, use amplitude_id
event_id bigint A counter that distinguishes events
event_type text The assigned type of event. Example 'Add Friend'
event_time timestamp without time zone Amplitude timestamp (UTC) which is the client_event_time adjusted by the difference between server_received_time and client_upload_time, specifically: event_time = client_event_time + (server_received_time - client_upload_time) 2015-08-10T12:00:00.000000 We use this timestamp to organize events on Amplitude charts. Note: If the difference between server_received_time and client_upload_time is less than 60 seconds, the event_time will not be adjusted and will equal the client_event_time
event_day date Day of event time
session_id bigint The session start time in milliseconds since epoch. All events within the same session share the same session ID. By default, the setting in Amplitude for the session property is session ID. All events with the same session ID and the same user ID will be grouped into the same session. The session ID does not have to be unique across multiple users. Session IDs for events sent via the Amplitude SDKs are automatically generated and managed. However, for events sent via the HTTP API, Amplitude defaults to a session ID of -1. This means the event is excluded from all session metrics.
amplitude_id text An internal ID used to count unique users.
app bigint Project ID found in your project's Settings page
project_name bigint Project ID
version_name integer The app version
client_event_time timestamp without time zone Local timestamp (UTC) of when the device logged the event.
client_upload_time timestamp without time zone The local timestamp (UTC) of when the device uploaded the event.
server_received_time timestamp without time zone Amplitude timestamp (UTC) of when servers received the event
server_upload_time timestamp without time zone Amplitude timestamp (UTC) of when the event data was uploaded to Amplitude servers
city integer City
country text Country
region integer Region
data text Dictionary where certain fields such as first_event and merged_amplitude_id are stored.
location_lat integer Latitude
location_lng integer Longitude
device_brand integer Device brand
device_carrier integer Device carrier.
device_family integer Device family. Apple iPhone
device_id text The device specific identifier
device_manufacturer integer Device manufacturer
device_model integer The device model
device_type integer Device type
ip_address text IP address
os_name integer OS name
os_version integer OS version
platform integer Platform of the device.
language integer The language set by the user
dma integer Designated marketing area (DMA)
schema bigint Schema ID
start_version integer App version the user was first tracked on
user_creation_time timestamp without time zone Event_time (UTC) of the user's first event
session_event_number bigint The number of the event within the session, ordered by time of event.
group_types text Group types. "Groups" in the source table, renamed here. See the Accounts documentation for more information.
user_id text A readable ID specified by you. Amplitude uses a combination of three different methods to identify your users: device IDs, Amplitude ID, and user IDs. The first comes directly from your users' devices, while the second is an ID that Amplitude automatically creates once it has enough information to conclusively identify a unique user. The user ID, however, is something you'd set up. In Amplitude, a user ID is a unique identifier applied to individual users. Using them is optional, but recommended: your product should set a user ID once a user has created an account, logged in, or is otherwise identified in your product. Amplitude can use a user ID to reconcile events across multiple devices under the same user ID. Additionally, a user's event data will be merged on the backend so that all anonymous events prior to the assignment of a user ID will be connected to the correct user. For this reason, you can wait to assign user IDs if that makes sense for your product. Conversely, this is also why you should not set user IDs for anonymous users. Once set, user IDs in Amplitude cannot be changed.Once set, user IDs in Amplitude cannot be changed.
event_type_id bigint Event type ID
event_type_name text Event type name
totals integer The total number of times the event has happened this week
value text Name of the event in the raw data.
events_per_session bigint The count of events in a session
session_started_at timestamp without time zone The time of the first event in a session
session_ended_at timestamp without time zone The time of the last event in a session
session_length None The length of the session, in seconds
is_first_user_session integer Boolean of whether or not a session is the user's first session
user_event_number bigint None
user_session_number bigint None
session_started_at_day timestamp without time zone None
session_ended_at_day timestamp without time zone None
session_length_in_minutes double precision None
minutes_in_between_sessions double precision None
unique_key text None
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_event_time device_id unique_event_id 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced unique_event_id 6. model.amplitude_source.stg_amplitude__event:f2->2. model.amplitude.amplitude__event_enhanced:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced total_events_per_user 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_events 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_event_time device_id 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f2
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Other Used in the MD5 hash to create unique_event_id
    • Output Columns:
      • device_id: Directly mapped
      • unique_event_id: Part of the MD5 hash
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create unique_event_id
    • Output Columns:
      • client_event_time: Directly copied after casting to TIMESTAMP
      • unique_event_id: Part of the MD5 hash to create this column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_event_id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Output Columns:
      • unique_event_id: Directly copied
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_event_id]
    • Aggregation Used in COUNT(DISTINCT unique_event_id) to calculate number_events
    • Output Columns:
      • number_events: Aggregated to count distinct events
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_event_id]
    • Aggregation Used to count distinct events per user
    • Output Columns:
      • total_events_per_user: Aggregated as COUNT(DISTINCT unique_event_id)
Column Lineage
%3 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions unique_session_id user_id 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_event_number session_id unique_session_id user_id 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f2 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced total_sessions_per_user 2. model.amplitude.amplitude__event_enhanced:f2->4. model.amplitude.amplitude__user_enhanced:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_sessions 2. model.amplitude.amplitude__event_enhanced:f2->1. model.amplitude.amplitude__daily_performance:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event amplitude_user_id session_id unique_session_id user_id 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f3->3. model.amplitude.amplitude__sessions:f1 6. model.amplitude_source.stg_amplitude__event:f3->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f2->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f0 6. model.amplitude_source.stg_amplitude__event:f3->2. model.amplitude.amplitude__event_enhanced:f3 6. model.amplitude_source.stg_amplitude__event:f3->2. model.amplitude.amplitude__event_enhanced:f2 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp session_id user_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f0
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_session_id]
    • Direct Directly used in the output
    • Aggregation Used as a grouping key
    • Output Columns:
      • unique_session_id: Directly copied
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[session_id]
    • Integration Used to create the unique_session_id by concatenating with user_id
    • Output Columns:
      • unique_session_id: Concatenated with user_id to form unique_session_id
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_id]
    • Direct Copied without transformation
    • Integration Used to create the unique_session_id by concatenating with session_id
    • Aggregation Used in GROUP BY clause for session aggregation
    • Deduplication Used in window functions for session ranking and lag calculations
    • Output Columns:
      • user_id: Directly copied
      • unique_session_id: Concatenated with session_id to form unique_session_id
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[session_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Other Used in creating the unique_session_id
    • Output Columns:
      • session_id: Directly mapped
      • unique_session_id: Part of MD5 hash with user_id
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[session_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Other Used in creating the unique_session_id
    • Output Columns:
      • session_id: Directly mapped
      • unique_session_id: Part of MD5 hash with user_id
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[unique_session_id]
    • Integration used as the key to join session_data with event_data
    • Direct directly copied to the output
    • Output Columns:
      • unique_session_id: directly copied
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_session_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the session_data CTE
    • Output Columns:
      • unique_session_id: Directly copied
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[session_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the unique_session_id
    • Deduplication Used in the ROW_NUMBER() function for session_event_number
    • Output Columns:
      • session_id: Directly copied
      • unique_session_id: Part of the concatenation
      • session_event_number: Used in the PARTITION BY clause
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_id]
    • Cleaning The column is cast as TEXT
    • Integration Used as part of the unique_session_id
    • Output Columns:
      • user_id: Cast as TEXT
      • unique_session_id: Part of the concatenation
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_session_id]
    • Aggregation Used in COUNT(DISTINCT unique_session_id) to calculate number_sessions
    • Output Columns:
      • number_sessions: Aggregated to count distinct sessions
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_session_id]
    • Integration Used to join the event_enhanced and session_data tables
    • Aggregation Used to count distinct sessions per user
    • Output Columns:
      • total_sessions_per_user: Aggregated as COUNT(DISTINCT unique_session_id)
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event amplitude_id amplitude_user_id unique_session_id user_id 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced amplitude_user_id 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced amplitude_user_id 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_new_users number_users 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f1 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp amplitude_id user_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[amplitude_id]
    • Cleaning The column is cast as TEXT
    • Other Used as a fallback for amplitude_user_id when user_id is null
    • Output Columns:
      • amplitude_id: Directly mapped after casting
      • amplitude_user_id: Used as fallback when user_id is null
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[amplitude_user_id]
    • Direct The column is directly copied without any transformation
    • Cleaning Cast as TEXT
    • Featurization Used to generate user_event_number
    • Output Columns:
      • amplitude_user_id: Directly copied after casting to TEXT
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[amplitude_user_id]
    • Aggregation Used in COUNT(DISTINCT amplitude_user_id) to calculate number_users and number_new_users
    • Output Columns:
      • number_users: Aggregated to count distinct users
      • number_new_users: Aggregated to count distinct new users
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[amplitude_user_id]
    • Integration Used as the key to join the event_enhanced and session_data tables
    • Aggregation Used as the grouping key for all aggregations
    • Output Columns:
      • amplitude_user_id: Directly copied to the output
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_id 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_id 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[id]
    • Cleaning The column is cast as INT
    • Output Columns:
      • event_id: Directly mapped after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • event_id: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_type 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_type 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 5. model.amplitude.int_amplitude__date_spine 5. model.amplitude.int_amplitude__date_spine event_type 2. model.amplitude.amplitude__event_enhanced:f0->5. model.amplitude.int_amplitude__date_spine:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance event_type 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_type 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 5. model.amplitude.int_amplitude__date_spine:f0->1. model.amplitude.amplitude__daily_performance:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • event_type: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_type]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with event_type table
    • Output Columns:
      • event_type: Directly copied
1. model.amplitude.amplitude__daily_performance
  • Input Column: 5. model.amplitude.int_amplitude__date_spine[event_type]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the agg_event_data CTE
    • Aggregation The column is grouped by in the agg_event_data CTE
    • Output Columns:
      • event_type: Directly mapped to the output column
5. model.amplitude.int_amplitude__date_spine
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_type]
    • Direct The event_type is directly selected from the event_data CTE
    • Integration Used to join with the spine CTE to create a record for each event type on every day
    • Output Columns:
      • event_type: Directly mapped to the output column
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_day event_time 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_time 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create event_day
    • Filtering Used to filter records based on date range
    • Output Columns:
      • event_time: Directly copied after casting
      • event_day: Derived from event_time
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_time]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with session data
    • Featurization Used to calculate session and user event numbers
    • Output Columns:
      • event_time: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_day event_time 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_day 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 5. model.amplitude.int_amplitude__date_spine 5. model.amplitude.int_amplitude__date_spine event_day 2. model.amplitude.amplitude__event_enhanced:f0->5. model.amplitude.int_amplitude__date_spine:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance event_day 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 5. model.amplitude.int_amplitude__date_spine:f0->1. model.amplitude.amplitude__daily_performance:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create event_day
    • Filtering Used to filter records based on date range
    • Output Columns:
      • event_time: Directly copied after casting
      • event_day: Derived from event_time
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_day]
    • Direct The column is directly copied without any transformation
    • Other Used in the unique_key generation
    • Output Columns:
      • event_day: Directly copied
1. model.amplitude.amplitude__daily_performance
  • Input Column: 5. model.amplitude.int_amplitude__date_spine[event_day]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the agg_event_data CTE
    • Aggregation The column is grouped by in the agg_event_data CTE
    • Output Columns:
      • event_day: Directly mapped to the output column
5. model.amplitude.int_amplitude__date_spine
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_day]
    • Integration Used to join with the spine CTE to ensure each event_type has a record for every day since their first day
    • Featurization Used to create the event_day column in the output
    • Output Columns:
      • event_day: Transformed from the spine.date_day and used as the output column
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event session_id unique_session_id 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_event_number session_id unique_session_id 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp session_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[session_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Other Used in creating the unique_session_id
    • Output Columns:
      • session_id: Directly mapped
      • unique_session_id: Part of MD5 hash with user_id
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[session_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the unique_session_id
    • Deduplication Used in the ROW_NUMBER() function for session_event_number
    • Output Columns:
      • session_id: Directly copied
      • unique_session_id: Part of the concatenation
      • session_event_number: Used in the PARTITION BY clause
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event amplitude_id amplitude_user_id 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced amplitude_id 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp amplitude_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[amplitude_id]
    • Cleaning The column is cast as TEXT
    • Other Used as a fallback for amplitude_user_id when user_id is null
    • Output Columns:
      • amplitude_id: Directly mapped after casting
      • amplitude_user_id: Used as fallback when user_id is null
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[amplitude_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • amplitude_id: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event app 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced app 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp app 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[app]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • app: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[app]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • app: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event project_name 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced project_name 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp project_name 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[project_name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • project_name: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[project_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • project_name: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event version_name 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced version_name 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp version_name 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[version_name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • version_name: It is directly mapped to the output column 'version_name'
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[version_name]
    • Direct Directly copied without any transformation
    • Output Columns:
      • version_name: Directly copied to the output column
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_event_time unique_event_id 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced client_event_time 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance event_day 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create unique_event_id
    • Output Columns:
      • client_event_time: Directly copied after casting to TIMESTAMP
      • unique_event_id: Part of the MD5 hash to create this column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_event_time]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Output Columns:
      • client_event_time: Directly copied
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[client_event_time]
    • Aggregation Used to determine the event day for grouping
    • Output Columns:
      • event_day: Derived from DATE_TRUNC('DAY', client_event_time)
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_upload_time 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced client_upload_time 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_upload_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_upload_time]
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • client_upload_time: Directly copied after casting to TIMESTAMP
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_upload_time]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ORDER BY clause of the ROW_NUMBER() function for deduplication
    • Output Columns:
      • client_upload_time: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event server_received_time 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced server_received_time 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp server_received_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[server_received_time]
    • Direct The column is directly copied
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • server_received_time: Cast as TIMESTAMP and directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[server_received_time]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • server_received_time: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event server_upload_time 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced server_upload_time 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp server_upload_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[server_upload_time]
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • server_upload_time: Directly mapped after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[server_upload_time]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • server_upload_time: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event city 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced city 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp city 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[city]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • city: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[city]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • city: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event country 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced country 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp country 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[country]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • country: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[country]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • country: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event region 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced region 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp region 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[region]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • region: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[region]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • region: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event data 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced data 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp data 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[data]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • data: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[data]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • data: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event location_lat 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced location_lat 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp location_lat 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[location_lat]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • location_lat: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[location_lat]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • location_lat: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event location_lng 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced location_lng 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp location_lng 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[location_lng]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • location_lng: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[location_lng]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • location_lng: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_brand 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_brand 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_brand 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_brand]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_brand: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_brand]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_brand: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_carrier 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_carrier 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_carrier 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_carrier]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_carrier: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_carrier]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_carrier: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_family 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_family 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_family 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_family]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_family: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_family]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_family: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_id unique_event_id 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_id 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Other Used in the MD5 hash to create unique_event_id
    • Output Columns:
      • device_id: Directly mapped
      • unique_event_id: Part of the MD5 hash
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the PARTITION BY clause for deduplication when _insert_id is NULL
    • Output Columns:
      • device_id: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_manufacturer 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_manufacturer 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_manufacturer 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_manufacturer]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_manufacturer: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_manufacturer]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_manufacturer: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_model 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_model 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_model 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_model]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_model: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_model]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_model: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_type 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_type 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_type 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_type: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_type: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event ip_address 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced ip_address 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp ip_address 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[ip_address]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ip_address: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[ip_address]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ip_address: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event os_name 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced os_name 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp os_name 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[os_name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • os_name: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[os_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • os_name: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event os_version 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced os_version 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp os_version 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[os_version]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • os_version: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[os_version]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • os_version: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event platform 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced platform 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp platform 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[platform]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • platform: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[platform]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • platform: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event language 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced language 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp language 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[language]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • language: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[language]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • language: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event dma 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced dma 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp dma 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[dma]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • dma: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[dma]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • dma: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event schema 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced schema 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp schema 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[schema]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • schema: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[schema]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • schema: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event start_version 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced start_version 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp start_version 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[start_version]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • start_version: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[start_version]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • start_version: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event user_creation_time 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced user_creation_time 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced user_created_at 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_new_users 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp user_creation_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_creation_time]
    • Direct The column is directly copied
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • user_creation_time: Cast as TIMESTAMP and directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_creation_time]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • user_creation_time: Directly copied
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[user_creation_time]
    • Featurization Used to determine if a user is new on a given day
    • Output Columns:
      • number_new_users: Contributes to the count of new users
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[user_creation_time]
    • Aggregation This column is used in the MIN function to determine the earliest user creation time.
    • Output Columns:
      • user_created_at: The MIN of this column is mapped to user_created_at in the output.
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event session_id unique_session_id 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_event_number session_id unique_session_id 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp session_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[session_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Other Used in creating the unique_session_id
    • Output Columns:
      • session_id: Directly mapped
      • unique_session_id: Part of MD5 hash with user_id
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[session_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the unique_session_id
    • Deduplication Used in the ROW_NUMBER() function for session_event_number
    • Output Columns:
      • session_id: Directly copied
      • unique_session_id: Part of the concatenation
      • session_event_number: Used in the PARTITION BY clause
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event group_types 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced group_types 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp groups 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[groups]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is renamed to group_types
    • Output Columns:
      • group_types: Directly copied and renamed
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[group_types]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • group_types: Directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event amplitude_user_id unique_session_id user_id 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced unique_session_id user_id 6. model.amplitude_source.stg_amplitude__event:f2->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event:f2->2. model.amplitude.amplitude__event_enhanced:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced amplitude_user_id 2. model.amplitude.amplitude__event_enhanced:f1->4. model.amplitude.amplitude__user_enhanced:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_new_users number_users 2. model.amplitude.amplitude__event_enhanced:f1->1. model.amplitude.amplitude__daily_performance:f1 2. model.amplitude.amplitude__event_enhanced:f1->1. model.amplitude.amplitude__daily_performance:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp user_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_id]
    • Cleaning The column is cast as TEXT
    • Integration Used as part of the unique_session_id
    • Output Columns:
      • user_id: Cast as TEXT
      • unique_session_id: Part of the concatenation
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[user_id]
    • Aggregation Used as part of COUNT(DISTINCT amplitude_user_id) to calculate number_users
    • Featurization Used to determine new users based on user_creation_time
    • Output Columns:
      • number_users: Aggregated to count distinct users
      • number_new_users: Used to identify new users
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[user_id]
    • Direct Used directly as amplitude_user_id
    • Integration Used to join with session_data table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • amplitude_user_id: Directly mapped
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_type_id 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_type_id 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type event_type_id unique_event_type_id 8. model.amplitude_source.stg_amplitude__event_type:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_type_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp id 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_type_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • event_type_id: Directly copied
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[id]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • event_type_id: Directly mapped after casting
      • unique_event_type_id: Used as part of the MD5 hash
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_type_id]
    • Integration Used to join with event_type table
    • Output Columns:
      • event_type_id: Directly copied
  • Input Column: 8. model.amplitude_source.stg_amplitude__event_type[event_type_id]
    • Integration Used as a key to join with event_data table
    • Direct Directly copied to the output
    • Output Columns:
      • event_type_id: Directly copied
Column Lineage
%3 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type event_type_name 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_type_name 8. model.amplitude_source.stg_amplitude__event_type:f0->2. model.amplitude.amplitude__event_enhanced:f0 5. model.amplitude.int_amplitude__date_spine 5. model.amplitude.int_amplitude__date_spine event_type 2. model.amplitude.amplitude__event_enhanced:f0->5. model.amplitude.int_amplitude__date_spine:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance event_type 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp name 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0 5. model.amplitude.int_amplitude__date_spine:f0->1. model.amplitude.amplitude__daily_performance:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • event_type_name: Directly mapped to this output column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 8. model.amplitude_source.stg_amplitude__event_type[event_type_name]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with event_data
    • Output Columns:
      • event_type_name: Directly mapped
1. model.amplitude.amplitude__daily_performance
  • Input Column: 5. model.amplitude.int_amplitude__date_spine[event_type]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the agg_event_data CTE
    • Aggregation The column is grouped by in the agg_event_data CTE
    • Output Columns:
      • event_type: Directly mapped to the output column
5. model.amplitude.int_amplitude__date_spine
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_type_name]
    • Integration Used to join with the spine table to create records for each event type
    • Output Columns:
      • event_type: Likely mapped directly to this output column
Column Lineage
%3 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type totals 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced totals 8. model.amplitude_source.stg_amplitude__event_type:f0->2. model.amplitude.amplitude__event_enhanced:f0 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp totals 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[totals]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • totals: Directly mapped to this output column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 8. model.amplitude_source.stg_amplitude__event_type[totals]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • totals: Directly mapped
Column Lineage
%3 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type value 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced value 8. model.amplitude_source.stg_amplitude__event_type:f0->2. model.amplitude.amplitude__event_enhanced:f0 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp value 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[value]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • value: Directly mapped to this output column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 8. model.amplitude_source.stg_amplitude__event_type[value]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • value: Directly mapped
Column Lineage
%3 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions events_per_session 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced events_per_session 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_id 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[id]
    • Cleaning The column is cast as INT
    • Output Columns:
      • event_id: Directly mapped after casting
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_id]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Aggregation Counted to calculate events_per_session
    • Output Columns:
      • events_per_session: Aggregated count of event_id
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[events_per_session]
    • Direct directly copied to the output
    • Output Columns:
      • events_per_session: directly copied
Column Lineage
%3 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_ended_at session_ended_at_day session_length_in_minutes session_started_at session_started_at_day 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_started_at 3. model.amplitude.amplitude__sessions:f3->2. model.amplitude.amplitude__event_enhanced:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced first_session_at 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_event_time event_day event_time unique_event_id 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f2 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f4 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f1 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_event_time event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create unique_event_id
    • Output Columns:
      • client_event_time: Directly copied after casting to TIMESTAMP
      • unique_event_id: Part of the MD5 hash to create this column
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create event_day
    • Filtering Used to filter records based on date range
    • Output Columns:
      • event_time: Directly copied after casting
      • event_day: Derived from event_time
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_event_time]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Aggregation Used to determine session start and end times
    • Output Columns:
      • session_started_at: Minimum client_event_time for a session
      • session_ended_at: Maximum client_event_time for a session
      • session_length_in_minutes: Calculated from the difference between max and min client_event_time
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_time]
    • Aggregation Used to determine session start and end times
    • Cleaning Truncated to day for session_started_at_day and session_ended_at_day
    • Output Columns:
      • session_started_at: Minimum event_time for a session
      • session_ended_at: Maximum event_time for a session
      • session_started_at_day: Truncated event_time to day for session start
      • session_ended_at_day: Truncated event_time to day for session end
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_started_at]
    • Direct directly copied to the output
    • Output Columns:
      • session_started_at: directly copied
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_started_at]
    • Aggregation Used in MIN function to find first session
    • Output Columns:
      • first_session_at: Aggregated to find the earliest session start
Column Lineage
%3 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_ended_at session_ended_at_day session_length_in_minutes session_started_at session_started_at_day 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_ended_at 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced last_session_at 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_event_time event_day event_time unique_event_id 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f2 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f4 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f1 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_event_time event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create unique_event_id
    • Output Columns:
      • client_event_time: Directly copied after casting to TIMESTAMP
      • unique_event_id: Part of the MD5 hash to create this column
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create event_day
    • Filtering Used to filter records based on date range
    • Output Columns:
      • event_time: Directly copied after casting
      • event_day: Derived from event_time
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_event_time]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Aggregation Used to determine session start and end times
    • Output Columns:
      • session_started_at: Minimum client_event_time for a session
      • session_ended_at: Maximum client_event_time for a session
      • session_length_in_minutes: Calculated from the difference between max and min client_event_time
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_time]
    • Aggregation Used to determine session start and end times
    • Cleaning Truncated to day for session_started_at_day and session_ended_at_day
    • Output Columns:
      • session_started_at: Minimum event_time for a session
      • session_ended_at: Maximum event_time for a session
      • session_started_at_day: Truncated event_time to day for session start
      • session_ended_at_day: Truncated event_time to day for session end
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_ended_at]
    • Direct directly copied to the output
    • Output Columns:
      • session_ended_at: directly copied
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_ended_at]
    • Aggregation Used in MAX function to find last session
    • Output Columns:
      • last_session_at: Aggregated to find the latest session end
Column Lineage
%3 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions is_first_user_session 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced is_first_user_session 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f0
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[is_first_user_session]
    • Direct This column is directly copied from the input to the output without any transformation.
    • Output Columns:
      • is_first_user_session: Directly copied to the output column with the same name.
Column Lineage
%3 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions user_session_number 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced user_session_number 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f0
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[user_session_number]
    • Direct directly copied to the output
    • Output Columns:
      • user_session_number: directly copied
Column Lineage
%3 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_ended_at session_ended_at_day session_started_at session_started_at_day 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_started_at_day 3. model.amplitude.amplitude__sessions:f3->2. model.amplitude.amplitude__event_enhanced:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced first_session_at 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_day event_time 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f2 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f1 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create event_day
    • Filtering Used to filter records based on date range
    • Output Columns:
      • event_time: Directly copied after casting
      • event_day: Derived from event_time
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_time]
    • Aggregation Used to determine session start and end times
    • Cleaning Truncated to day for session_started_at_day and session_ended_at_day
    • Output Columns:
      • session_started_at: Minimum event_time for a session
      • session_ended_at: Maximum event_time for a session
      • session_started_at_day: Truncated event_time to day for session start
      • session_ended_at_day: Truncated event_time to day for session end
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_started_at_day]
    • Direct directly copied to the output
    • Output Columns:
      • session_started_at_day: directly copied
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_started_at_day]
    • Aggregation This column is used in the MIN() function to determine the first session date for each user.
    • Output Columns:
      • first_session_at: The minimum value of this column is used to determine the first session timestamp for each user.
Column Lineage
%3 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_ended_at session_ended_at_day session_started_at session_started_at_day 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_ended_at_day 3. model.amplitude.amplitude__sessions:f1->2. model.amplitude.amplitude__event_enhanced:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced last_session_at 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_day event_time 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f2 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f1 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create event_day
    • Filtering Used to filter records based on date range
    • Output Columns:
      • event_time: Directly copied after casting
      • event_day: Derived from event_time
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_time]
    • Aggregation Used to determine session start and end times
    • Cleaning Truncated to day for session_started_at_day and session_ended_at_day
    • Output Columns:
      • session_started_at: Minimum event_time for a session
      • session_ended_at: Maximum event_time for a session
      • session_started_at_day: Truncated event_time to day for session start
      • session_ended_at_day: Truncated event_time to day for session end
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_ended_at_day]
    • Direct directly copied to the output
    • Output Columns:
      • session_ended_at_day: directly copied
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_ended_at_day]
    • Aggregation This column is used in the MAX() function to determine the last session date for each user.
    • Output Columns:
      • last_session_at: The maximum value of this column is used to determine the last session timestamp for each user.
Column Lineage
%3 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_ended_at session_length_in_minutes session_started_at 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_length_in_minutes 3. model.amplitude.amplitude__sessions:f1->2. model.amplitude.amplitude__event_enhanced:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced average_session_length_in_minutes 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_event_time unique_event_id 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f2 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f1 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create unique_event_id
    • Output Columns:
      • client_event_time: Directly copied after casting to TIMESTAMP
      • unique_event_id: Part of the MD5 hash to create this column
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_event_time]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Aggregation Used to determine session start and end times
    • Output Columns:
      • session_started_at: Minimum client_event_time for a session
      • session_ended_at: Maximum client_event_time for a session
      • session_length_in_minutes: Calculated from the difference between max and min client_event_time
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_length_in_minutes]
    • Direct This column is directly copied from the input to the output without any transformation.
    • Output Columns:
      • session_length_in_minutes: Directly copied to the output column with the same name.
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_length_in_minutes]
    • Aggregation This column is used in the AVG() function to calculate the average session length for each user.
    • Output Columns:
      • average_session_length_in_minutes: The average value of this column is calculated for each user.
Column Lineage
%3 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions minutes_in_between_sessions 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced minutes_in_between_sessions 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced average_minutes_in_between_sessions 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[minutes_in_between_sessions]
    • Direct This column is directly copied from the input to the output without any transformation.
    • Output Columns:
      • minutes_in_between_sessions: Directly copied to the output column with the same name.
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[minutes_in_between_sessions]
    • Aggregation This column is used in the AVG() function to calculate the average time between sessions for each user.
    • Output Columns:
      • average_minutes_in_between_sessions: The average value of this column is calculated for each user.
Column Lineage
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced unique_key 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced total_events_per_user 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_key]
    • Aggregation This column is used in the COUNT(DISTINCT) function to count the total number of events for each user.
    • Output Columns:
      • total_events_per_user: The count of distinct values of this column is calculated for each user.
3. model.amplitude.amplitude__sessions

This SQL query processes event data from Amplitude to create a comprehensive session analysis. It deduplicates raw event data, aggregates events into sessions, calculates session metrics (such as duration and events per session), ranks sessions by user, and determines time between sessions. The query also identifies first sessions for each user and calculates the time gap between consecutive sessions.

DeduplicationAggregationFeaturizationCleaning
SQL Query
WITH event_data_raw AS (
  SELECT
    events.*
  FROM TEST.PUBLIC__source_amplitude.stg_amplitude__event AS events
), event_data /* deduplicate */ AS (
  SELECT
    *
  FROM (
    SELECT
      *,
      CASE
        WHEN NOT _insert_id IS NULL
        THEN ROW_NUMBER() OVER (PARTITION BY _insert_id ORDER BY client_upload_time DESC)
        ELSE ROW_NUMBER() OVER (PARTITION BY event_id, device_id, client_event_time, amplitude_user_id ORDER BY client_upload_time DESC)
      END AS nth_event_record
    FROM event_data_raw
  ) AS duplicates
  WHERE
    nth_event_record = 1
), session_agg AS (
  SELECT
    unique_session_id,
    user_id,
    COUNT(event_id) AS events_per_session,
    MIN(event_time) AS session_started_at,
    MAX(event_time) AS session_ended_at,
    DATEDIFF(second, MIN(event_time), MAX(event_time)) / 60 AS session_length_in_minutes
  FROM event_data
  GROUP BY
    1,
    2
), session_ranking AS (
  SELECT
    unique_session_id,
    user_id,
    events_per_session,
    session_started_at,
    session_ended_at,
    session_length_in_minutes,
    DATE_TRUNC('DAY', session_started_at) AS session_started_at_day,
    DATE_TRUNC('DAY', session_ended_at) AS session_ended_at_day,
    CASE
      WHEN NOT user_id IS NULL
      THEN ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY session_started_at)
      ELSE NULL
    END AS user_session_number
  FROM session_agg
), session_lag AS (
  SELECT
    *,
    CASE
      WHEN NOT user_id IS NULL
      THEN LAG(session_ended_at, 1) OVER (PARTITION BY user_id ORDER BY session_ended_at)
      ELSE NULL
    END AS last_session_ended_at, /* determine prior sessions' end time, then in the following cte calculate the difference between current session's start time and last session's end time to determine the time in between sessions */
    CASE
      WHEN NOT user_id IS NULL
      THEN LAG(session_ended_at_day, 1) OVER (PARTITION BY user_id ORDER BY session_ended_at_day)
      ELSE NULL
    END AS last_session_ended_at_day
  FROM session_ranking
)
SELECT
  *,
  CASE WHEN user_session_number = 1 THEN 1 ELSE 0 END AS is_first_user_session,
  CASE
    WHEN NOT user_id IS NULL
    THEN DATEDIFF(second, last_session_ended_at, SESSION_STARTED_AT) / 60
    ELSE NULL
  END AS minutes_in_between_sessions
FROM session_lag
%3 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions unique_session_id user_id events_per_session session_started_at session_ended_at session_length session_started_at_day session_ended_at_day user_session_number last_session_ended_at last_session_ended_at_day is_first_user_session seconds_in_between_sessions minutes_in_between_sessions days_in_between_sessions session_length_in_minutes 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event unique_event_id event_id unique_session_id amplitude_user_id client_event_time client_upload_time device_id event_time _insert_id session_id user_id uuid 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f2 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f4->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f4->3. model.amplitude.amplitude__sessions:f4 6. model.amplitude_source.stg_amplitude__event:f4->3. model.amplitude.amplitude__sessions:f15 6. model.amplitude_source.stg_amplitude__event:f7->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f7->3. model.amplitude.amplitude__sessions:f4 6. model.amplitude_source.stg_amplitude__event:f7->3. model.amplitude.amplitude__sessions:f6 6. model.amplitude_source.stg_amplitude__event:f7->3. model.amplitude.amplitude__sessions:f7 6. model.amplitude_source.stg_amplitude__event:f9->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f10->3. model.amplitude.amplitude__sessions:f1 6. model.amplitude_source.stg_amplitude__event:f10->3. model.amplitude.amplitude__sessions:f0
Name Type Comment
unique_session_id text Unique key of each session, concatenating user_id and session_id
user_id text A readable ID specified by you. Amplitude uses a combination of three different methods to identify your users: device IDs, Amplitude ID, and user IDs. The first comes directly from your users' devices, while the second is an ID that Amplitude automatically creates once it has enough information to conclusively identify a unique user. The user ID, however, is something you'd set up. In Amplitude, a user ID is a unique identifier applied to individual users. Using them is optional, but recommended: your product should set a user ID once a user has created an account, logged in, or is otherwise identified in your product. Amplitude can use a user ID to reconcile events across multiple devices under the same user ID. Additionally, a user's event data will be merged on the backend so that all anonymous events prior to the assignment of a user ID will be connected to the correct user. For this reason, you can wait to assign user IDs if that makes sense for your product. Conversely, this is also why you should not set user IDs for anonymous users. Once set, user IDs in Amplitude cannot be changed.Once set, user IDs in Amplitude cannot be changed.
events_per_session bigint The count of events in a session
session_started_at timestamp without time zone The time of the first event in a session
session_ended_at timestamp without time zone The time of the last event in a session
session_length None The length of the session, in seconds
session_started_at_day timestamp without time zone The day the session started
session_ended_at_day timestamp without time zone The day the session ended
user_session_number bigint The number of the session, within a user's lifetime
last_session_ended_at timestamp without time zone The time the prior session ended at
last_session_ended_at_day timestamp without time zone The day the prior session ended
is_first_user_session integer Boolean of whether or not a session is the user's first session
seconds_in_between_sessions None The seconds in between sessions of a user
minutes_in_between_sessions double precision The minutes in between sessions of a user
days_in_between_sessions None The days in between sessions of a user
session_length_in_minutes double precision None
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event amplitude_user_id session_id unique_session_id user_id 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions unique_session_id user_id 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f3->3. model.amplitude.amplitude__sessions:f1 6. model.amplitude_source.stg_amplitude__event:f3->3. model.amplitude.amplitude__sessions:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced unique_session_id 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced total_sessions_per_user 3. model.amplitude.amplitude__sessions:f0->4. model.amplitude.amplitude__user_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp session_id user_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_sessions 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[session_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Other Used in creating the unique_session_id
    • Output Columns:
      • session_id: Directly mapped
      • unique_session_id: Part of MD5 hash with user_id
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[session_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Other Used in creating the unique_session_id
    • Output Columns:
      • session_id: Directly mapped
      • unique_session_id: Part of MD5 hash with user_id
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_session_id]
    • Direct Directly used in the output
    • Aggregation Used as a grouping key
    • Output Columns:
      • unique_session_id: Directly copied
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[session_id]
    • Integration Used to create the unique_session_id by concatenating with user_id
    • Output Columns:
      • unique_session_id: Concatenated with user_id to form unique_session_id
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_id]
    • Direct Copied without transformation
    • Integration Used to create the unique_session_id by concatenating with session_id
    • Aggregation Used in GROUP BY clause for session aggregation
    • Deduplication Used in window functions for session ranking and lag calculations
    • Output Columns:
      • user_id: Directly copied
      • unique_session_id: Concatenated with session_id to form unique_session_id
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[unique_session_id]
    • Integration used as the key to join session_data with event_data
    • Direct directly copied to the output
    • Output Columns:
      • unique_session_id: directly copied
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_session_id]
    • Integration Used to join the event_enhanced and session_data tables
    • Aggregation Used to count distinct sessions per user
    • Output Columns:
      • total_sessions_per_user: Aggregated as COUNT(DISTINCT unique_session_id)
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_session_id]
    • Aggregation Used in COUNT(DISTINCT unique_session_id) to calculate number_sessions
    • Output Columns:
      • number_sessions: Aggregated to count distinct sessions
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event amplitude_user_id unique_session_id user_id 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions unique_session_id user_id 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f1 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp user_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_id]
    • Direct Copied without transformation
    • Integration Used to create the unique_session_id by concatenating with session_id
    • Aggregation Used in GROUP BY clause for session aggregation
    • Deduplication Used in window functions for session ranking and lag calculations
    • Output Columns:
      • user_id: Directly copied
      • unique_session_id: Concatenated with session_id to form unique_session_id
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_id 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions events_per_session 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced events_per_session 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[id]
    • Cleaning The column is cast as INT
    • Output Columns:
      • event_id: Directly mapped after casting
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_id]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Aggregation Counted to calculate events_per_session
    • Output Columns:
      • events_per_session: Aggregated count of event_id
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[events_per_session]
    • Direct directly copied to the output
    • Output Columns:
      • events_per_session: directly copied
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_event_time event_day event_time unique_event_id 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_ended_at session_ended_at_day session_length_in_minutes session_started_at session_started_at_day 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f2 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f4 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f1 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_started_at 3. model.amplitude.amplitude__sessions:f3->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_event_time event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced first_session_at 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create unique_event_id
    • Output Columns:
      • client_event_time: Directly copied after casting to TIMESTAMP
      • unique_event_id: Part of the MD5 hash to create this column
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create event_day
    • Filtering Used to filter records based on date range
    • Output Columns:
      • event_time: Directly copied after casting
      • event_day: Derived from event_time
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_event_time]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Aggregation Used to determine session start and end times
    • Output Columns:
      • session_started_at: Minimum client_event_time for a session
      • session_ended_at: Maximum client_event_time for a session
      • session_length_in_minutes: Calculated from the difference between max and min client_event_time
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_time]
    • Aggregation Used to determine session start and end times
    • Cleaning Truncated to day for session_started_at_day and session_ended_at_day
    • Output Columns:
      • session_started_at: Minimum event_time for a session
      • session_ended_at: Maximum event_time for a session
      • session_started_at_day: Truncated event_time to day for session start
      • session_ended_at_day: Truncated event_time to day for session end
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_started_at]
    • Direct directly copied to the output
    • Output Columns:
      • session_started_at: directly copied
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_started_at]
    • Aggregation Used in MIN function to find first session
    • Output Columns:
      • first_session_at: Aggregated to find the earliest session start
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_event_time event_day event_time unique_event_id 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_ended_at session_ended_at_day session_length_in_minutes session_started_at session_started_at_day 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f2 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f4 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f1 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_ended_at 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_event_time event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced last_session_at 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create unique_event_id
    • Output Columns:
      • client_event_time: Directly copied after casting to TIMESTAMP
      • unique_event_id: Part of the MD5 hash to create this column
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create event_day
    • Filtering Used to filter records based on date range
    • Output Columns:
      • event_time: Directly copied after casting
      • event_day: Derived from event_time
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_event_time]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Aggregation Used to determine session start and end times
    • Output Columns:
      • session_started_at: Minimum client_event_time for a session
      • session_ended_at: Maximum client_event_time for a session
      • session_length_in_minutes: Calculated from the difference between max and min client_event_time
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_time]
    • Aggregation Used to determine session start and end times
    • Cleaning Truncated to day for session_started_at_day and session_ended_at_day
    • Output Columns:
      • session_started_at: Minimum event_time for a session
      • session_ended_at: Maximum event_time for a session
      • session_started_at_day: Truncated event_time to day for session start
      • session_ended_at_day: Truncated event_time to day for session end
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_ended_at]
    • Direct directly copied to the output
    • Output Columns:
      • session_ended_at: directly copied
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_ended_at]
    • Aggregation Used in MAX function to find last session
    • Output Columns:
      • last_session_at: Aggregated to find the latest session end
Column Lineage
%3 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_length 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced average_session_length_in_minutes 3. model.amplitude.amplitude__sessions:f0->4. model.amplitude.amplitude__user_enhanced:f0
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_length]
    • Aggregation Used in AVG calculation for average session length
    • Output Columns:
      • average_session_length_in_minutes: Averaged to get the mean session length in minutes
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_day event_time 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_ended_at session_ended_at_day session_started_at session_started_at_day 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f2 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f1 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_started_at_day 3. model.amplitude.amplitude__sessions:f3->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced first_session_at 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create event_day
    • Filtering Used to filter records based on date range
    • Output Columns:
      • event_time: Directly copied after casting
      • event_day: Derived from event_time
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_time]
    • Aggregation Used to determine session start and end times
    • Cleaning Truncated to day for session_started_at_day and session_ended_at_day
    • Output Columns:
      • session_started_at: Minimum event_time for a session
      • session_ended_at: Maximum event_time for a session
      • session_started_at_day: Truncated event_time to day for session start
      • session_ended_at_day: Truncated event_time to day for session end
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_started_at_day]
    • Direct directly copied to the output
    • Output Columns:
      • session_started_at_day: directly copied
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_started_at_day]
    • Aggregation This column is used in the MIN() function to determine the first session date for each user.
    • Output Columns:
      • first_session_at: The minimum value of this column is used to determine the first session timestamp for each user.
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_day event_time 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_ended_at session_ended_at_day session_started_at session_started_at_day 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f2 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f1 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_ended_at_day 3. model.amplitude.amplitude__sessions:f1->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced last_session_at 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create event_day
    • Filtering Used to filter records based on date range
    • Output Columns:
      • event_time: Directly copied after casting
      • event_day: Derived from event_time
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_time]
    • Aggregation Used to determine session start and end times
    • Cleaning Truncated to day for session_started_at_day and session_ended_at_day
    • Output Columns:
      • session_started_at: Minimum event_time for a session
      • session_ended_at: Maximum event_time for a session
      • session_started_at_day: Truncated event_time to day for session start
      • session_ended_at_day: Truncated event_time to day for session end
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_ended_at_day]
    • Direct directly copied to the output
    • Output Columns:
      • session_ended_at_day: directly copied
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_ended_at_day]
    • Aggregation This column is used in the MAX() function to determine the last session date for each user.
    • Output Columns:
      • last_session_at: The maximum value of this column is used to determine the last session timestamp for each user.
Column Lineage
%3 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions user_session_number 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced user_session_number 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f0
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[user_session_number]
    • Direct directly copied to the output
    • Output Columns:
      • user_session_number: directly copied
Column Lineage
%3 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions is_first_user_session 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced is_first_user_session 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f0
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[is_first_user_session]
    • Direct This column is directly copied from the input to the output without any transformation.
    • Output Columns:
      • is_first_user_session: Directly copied to the output column with the same name.
Column Lineage
%3 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions minutes_in_between_sessions 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced minutes_in_between_sessions 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced average_minutes_in_between_sessions 3. model.amplitude.amplitude__sessions:f0->4. model.amplitude.amplitude__user_enhanced:f0 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[minutes_in_between_sessions]
    • Direct This column is directly copied from the input to the output without any transformation.
    • Output Columns:
      • minutes_in_between_sessions: Directly copied to the output column with the same name.
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[minutes_in_between_sessions]
    • Aggregation This column is used in the AVG() function to calculate the average time between sessions for each user.
    • Output Columns:
      • average_minutes_in_between_sessions: The average value of this column is calculated for each user.
Column Lineage
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_event_time unique_event_id 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_ended_at session_length_in_minutes session_started_at 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f2 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f1 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_length_in_minutes 3. model.amplitude.amplitude__sessions:f1->2. model.amplitude.amplitude__event_enhanced:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced average_session_length_in_minutes 3. model.amplitude.amplitude__sessions:f1->4. model.amplitude.amplitude__user_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create unique_event_id
    • Output Columns:
      • client_event_time: Directly copied after casting to TIMESTAMP
      • unique_event_id: Part of the MD5 hash to create this column
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_event_time]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Aggregation Used to determine session start and end times
    • Output Columns:
      • session_started_at: Minimum client_event_time for a session
      • session_ended_at: Maximum client_event_time for a session
      • session_length_in_minutes: Calculated from the difference between max and min client_event_time
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_length_in_minutes]
    • Direct This column is directly copied from the input to the output without any transformation.
    • Output Columns:
      • session_length_in_minutes: Directly copied to the output column with the same name.
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_length_in_minutes]
    • Aggregation This column is used in the AVG() function to calculate the average session length for each user.
    • Output Columns:
      • average_session_length_in_minutes: The average value of this column is calculated for each user.
4. model.amplitude.amplitude__user_enhanced

This query combines data from two tables (amplitude__event_enhanced and amplitude__sessions) to create a user-centric view. It calculates various user metrics including their creation time, first and last session times, total events and sessions, average session length, and average time between sessions. The results are grouped by the user ID, providing a comprehensive overview of user activity and engagement.

IntegrationAggregationFeaturization
SQL Query
WITH event_enhanced AS (
  SELECT
    *
  FROM TEST.PUBLIC_amplitude.amplitude__event_enhanced
), session_data AS (
  SELECT
    *
  FROM TEST.PUBLIC_amplitude.amplitude__sessions
)
SELECT
  event_enhanced.amplitude_user_id,
  MIN(event_enhanced.user_creation_time) AS user_created_at,
  MIN(event_enhanced.session_started_at) AS first_session_at,
  MAX(event_enhanced.session_ended_at) AS last_session_at,
  COUNT(DISTINCT event_enhanced.unique_event_id) AS total_events_per_user,
  COUNT(DISTINCT session_data.unique_session_id) AS total_sessions_per_user,
  AVG(session_data.session_length_in_minutes) AS average_session_length_in_minutes,
  AVG(session_data.minutes_in_between_sessions) AS average_minutes_in_between_sessions
FROM event_enhanced
LEFT JOIN session_data
  ON event_enhanced.unique_session_id = session_data.unique_session_id
GROUP BY
  1
%3 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced amplitude_user_id user_created_at first_session_at last_session_at total_events_per_user total_sessions_per_user average_session_length average_seconds_in_between_sessions average_minutes_in_between_sessions average_days_in_between_sessions average_session_length_in_minutes 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced unique_event_id unique_session_id amplitude_user_id user_creation_time session_started_at session_ended_at user_id session_started_at_day session_ended_at_day session_length_in_minutes minutes_in_between_sessions unique_key 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f4 2. model.amplitude.amplitude__event_enhanced:f1->4. model.amplitude.amplitude__user_enhanced:f5 2. model.amplitude.amplitude__event_enhanced:f2->4. model.amplitude.amplitude__user_enhanced:f0 2. model.amplitude.amplitude__event_enhanced:f3->4. model.amplitude.amplitude__user_enhanced:f1 2. model.amplitude.amplitude__event_enhanced:f4->4. model.amplitude.amplitude__user_enhanced:f2 2. model.amplitude.amplitude__event_enhanced:f5->4. model.amplitude.amplitude__user_enhanced:f3 2. model.amplitude.amplitude__event_enhanced:f6->4. model.amplitude.amplitude__user_enhanced:f0 2. model.amplitude.amplitude__event_enhanced:f7->4. model.amplitude.amplitude__user_enhanced:f2 2. model.amplitude.amplitude__event_enhanced:f8->4. model.amplitude.amplitude__user_enhanced:f3 2. model.amplitude.amplitude__event_enhanced:f9->4. model.amplitude.amplitude__user_enhanced:f10 2. model.amplitude.amplitude__event_enhanced:f10->4. model.amplitude.amplitude__user_enhanced:f8 2. model.amplitude.amplitude__event_enhanced:f11->4. model.amplitude.amplitude__user_enhanced:f4 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions unique_session_id session_length minutes_in_between_sessions session_length_in_minutes 3. model.amplitude.amplitude__sessions:f0->4. model.amplitude.amplitude__user_enhanced:f5 3. model.amplitude.amplitude__sessions:f1->4. model.amplitude.amplitude__user_enhanced:f10 3. model.amplitude.amplitude__sessions:f2->4. model.amplitude.amplitude__user_enhanced:f8 3. model.amplitude.amplitude__sessions:f3->4. model.amplitude.amplitude__user_enhanced:f10
Name Type Comment
amplitude_user_id text Unique key for each user, which is user_id by default. If user_id does not exist, use amplitude_id
user_created_at timestamp without time zone Event_time (UTC) of the user's first event
first_session_at timestamp without time zone Timestamp of user's first recorded activity
last_session_at timestamp without time zone Timestamp of user's most recent activity
total_events_per_user bigint The total number of events for a certain user
total_sessions_per_user bigint The total number of sessions for a certain user
average_session_length None Average length of sessions, in seconds
average_seconds_in_between_sessions None Average time in between sessions for a user, in seconds
average_minutes_in_between_sessions double precision Average time in between sessions for a user, in minutes
average_days_in_between_sessions None Average time in between sessions for a user, in days
average_session_length_in_minutes double precision None
Column Lineage
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced amplitude_user_id unique_session_id user_id 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced amplitude_user_id 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 2. model.amplitude.amplitude__event_enhanced:f2->4. model.amplitude.amplitude__user_enhanced:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event amplitude_id amplitude_user_id unique_session_id user_id 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f0 6. model.amplitude_source.stg_amplitude__event:f3->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event:f3->2. model.amplitude.amplitude__event_enhanced:f1 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp amplitude_id user_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[amplitude_id]
    • Cleaning The column is cast as TEXT
    • Other Used as a fallback for amplitude_user_id when user_id is null
    • Output Columns:
      • amplitude_id: Directly mapped after casting
      • amplitude_user_id: Used as fallback when user_id is null
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[amplitude_user_id]
    • Direct The column is directly copied without any transformation
    • Cleaning Cast as TEXT
    • Featurization Used to generate user_event_number
    • Output Columns:
      • amplitude_user_id: Directly copied after casting to TEXT
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_id]
    • Cleaning The column is cast as TEXT
    • Integration Used as part of the unique_session_id
    • Output Columns:
      • user_id: Cast as TEXT
      • unique_session_id: Part of the concatenation
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[amplitude_user_id]
    • Integration Used as the key to join the event_enhanced and session_data tables
    • Aggregation Used as the grouping key for all aggregations
    • Output Columns:
      • amplitude_user_id: Directly copied to the output
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[user_id]
    • Direct Used directly as amplitude_user_id
    • Integration Used to join with session_data table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • amplitude_user_id: Directly mapped
Column Lineage
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced user_creation_time 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced user_created_at 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event user_creation_time 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp user_creation_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_creation_time]
    • Direct The column is directly copied
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • user_creation_time: Cast as TIMESTAMP and directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_creation_time]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • user_creation_time: Directly copied
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[user_creation_time]
    • Aggregation This column is used in the MIN function to determine the earliest user creation time.
    • Output Columns:
      • user_created_at: The MIN of this column is mapped to user_created_at in the output.
Column Lineage
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_started_at session_started_at_day 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced first_session_at 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 2. model.amplitude.amplitude__event_enhanced:f1->4. model.amplitude.amplitude__user_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_ended_at session_ended_at_day session_length_in_minutes session_started_at session_started_at_day 3. model.amplitude.amplitude__sessions:f3->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions:f4->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_event_time event_day event_time unique_event_id 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f2 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f4 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f1 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f4 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f1 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_event_time event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create unique_event_id
    • Output Columns:
      • client_event_time: Directly copied after casting to TIMESTAMP
      • unique_event_id: Part of the MD5 hash to create this column
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create event_day
    • Filtering Used to filter records based on date range
    • Output Columns:
      • event_time: Directly copied after casting
      • event_day: Derived from event_time
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_event_time]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Aggregation Used to determine session start and end times
    • Output Columns:
      • session_started_at: Minimum client_event_time for a session
      • session_ended_at: Maximum client_event_time for a session
      • session_length_in_minutes: Calculated from the difference between max and min client_event_time
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_time]
    • Aggregation Used to determine session start and end times
    • Cleaning Truncated to day for session_started_at_day and session_ended_at_day
    • Output Columns:
      • session_started_at: Minimum event_time for a session
      • session_ended_at: Maximum event_time for a session
      • session_started_at_day: Truncated event_time to day for session start
      • session_ended_at_day: Truncated event_time to day for session end
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_time]
    • Aggregation Used to determine session start and end times
    • Cleaning Truncated to day for session_started_at_day and session_ended_at_day
    • Output Columns:
      • session_started_at: Minimum event_time for a session
      • session_ended_at: Maximum event_time for a session
      • session_started_at_day: Truncated event_time to day for session start
      • session_ended_at_day: Truncated event_time to day for session end
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_started_at]
    • Direct directly copied to the output
    • Output Columns:
      • session_started_at: directly copied
  • Input Column: 3. model.amplitude.amplitude__sessions[session_started_at_day]
    • Direct directly copied to the output
    • Output Columns:
      • session_started_at_day: directly copied
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_started_at]
    • Aggregation Used in MIN function to find first session
    • Output Columns:
      • first_session_at: Aggregated to find the earliest session start
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_started_at_day]
    • Aggregation This column is used in the MIN() function to determine the first session date for each user.
    • Output Columns:
      • first_session_at: The minimum value of this column is used to determine the first session timestamp for each user.
Column Lineage
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_ended_at session_ended_at_day 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced last_session_at 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 2. model.amplitude.amplitude__event_enhanced:f1->4. model.amplitude.amplitude__user_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_ended_at session_ended_at_day session_length_in_minutes session_started_at session_started_at_day 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions:f1->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_event_time event_day event_time unique_event_id 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f2 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f4 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f1 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f4 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f1 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_event_time event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create unique_event_id
    • Output Columns:
      • client_event_time: Directly copied after casting to TIMESTAMP
      • unique_event_id: Part of the MD5 hash to create this column
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create event_day
    • Filtering Used to filter records based on date range
    • Output Columns:
      • event_time: Directly copied after casting
      • event_day: Derived from event_time
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_event_time]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Aggregation Used to determine session start and end times
    • Output Columns:
      • session_started_at: Minimum client_event_time for a session
      • session_ended_at: Maximum client_event_time for a session
      • session_length_in_minutes: Calculated from the difference between max and min client_event_time
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_time]
    • Aggregation Used to determine session start and end times
    • Cleaning Truncated to day for session_started_at_day and session_ended_at_day
    • Output Columns:
      • session_started_at: Minimum event_time for a session
      • session_ended_at: Maximum event_time for a session
      • session_started_at_day: Truncated event_time to day for session start
      • session_ended_at_day: Truncated event_time to day for session end
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_time]
    • Aggregation Used to determine session start and end times
    • Cleaning Truncated to day for session_started_at_day and session_ended_at_day
    • Output Columns:
      • session_started_at: Minimum event_time for a session
      • session_ended_at: Maximum event_time for a session
      • session_started_at_day: Truncated event_time to day for session start
      • session_ended_at_day: Truncated event_time to day for session end
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_ended_at]
    • Direct directly copied to the output
    • Output Columns:
      • session_ended_at: directly copied
  • Input Column: 3. model.amplitude.amplitude__sessions[session_ended_at_day]
    • Direct directly copied to the output
    • Output Columns:
      • session_ended_at_day: directly copied
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_ended_at]
    • Aggregation Used in MAX function to find last session
    • Output Columns:
      • last_session_at: Aggregated to find the latest session end
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_ended_at_day]
    • Aggregation This column is used in the MAX() function to determine the last session date for each user.
    • Output Columns:
      • last_session_at: The maximum value of this column is used to determine the last session timestamp for each user.
Column Lineage
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced unique_event_id unique_key 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced total_events_per_user 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 2. model.amplitude.amplitude__event_enhanced:f1->4. model.amplitude.amplitude__user_enhanced:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_event_time device_id unique_event_id 6. model.amplitude_source.stg_amplitude__event:f2->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_event_time device_id 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f2
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Other Used in the MD5 hash to create unique_event_id
    • Output Columns:
      • device_id: Directly mapped
      • unique_event_id: Part of the MD5 hash
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create unique_event_id
    • Output Columns:
      • client_event_time: Directly copied after casting to TIMESTAMP
      • unique_event_id: Part of the MD5 hash to create this column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_event_id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Output Columns:
      • unique_event_id: Directly copied
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_event_id]
    • Aggregation Used to count distinct events per user
    • Output Columns:
      • total_events_per_user: Aggregated as COUNT(DISTINCT unique_event_id)
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_key]
    • Aggregation This column is used in the COUNT(DISTINCT) function to count the total number of events for each user.
    • Output Columns:
      • total_events_per_user: The count of distinct values of this column is calculated for each user.
Column Lineage
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_event_number session_id unique_session_id user_id 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced total_sessions_per_user 2. model.amplitude.amplitude__event_enhanced:f2->4. model.amplitude.amplitude__user_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions unique_session_id user_id 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f2 3. model.amplitude.amplitude__sessions:f0->4. model.amplitude.amplitude__user_enhanced:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event amplitude_user_id session_id unique_session_id user_id 6. model.amplitude_source.stg_amplitude__event:f2->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f0 6. model.amplitude_source.stg_amplitude__event:f3->2. model.amplitude.amplitude__event_enhanced:f3 6. model.amplitude_source.stg_amplitude__event:f3->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f3->3. model.amplitude.amplitude__sessions:f1 6. model.amplitude_source.stg_amplitude__event:f3->3. model.amplitude.amplitude__sessions:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp session_id user_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[session_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Other Used in creating the unique_session_id
    • Output Columns:
      • session_id: Directly mapped
      • unique_session_id: Part of MD5 hash with user_id
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[session_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Other Used in creating the unique_session_id
    • Output Columns:
      • session_id: Directly mapped
      • unique_session_id: Part of MD5 hash with user_id
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[unique_session_id]
    • Integration used as the key to join session_data with event_data
    • Direct directly copied to the output
    • Output Columns:
      • unique_session_id: directly copied
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_session_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the session_data CTE
    • Output Columns:
      • unique_session_id: Directly copied
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[session_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the unique_session_id
    • Deduplication Used in the ROW_NUMBER() function for session_event_number
    • Output Columns:
      • session_id: Directly copied
      • unique_session_id: Part of the concatenation
      • session_event_number: Used in the PARTITION BY clause
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_id]
    • Cleaning The column is cast as TEXT
    • Integration Used as part of the unique_session_id
    • Output Columns:
      • user_id: Cast as TEXT
      • unique_session_id: Part of the concatenation
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_session_id]
    • Direct Directly used in the output
    • Aggregation Used as a grouping key
    • Output Columns:
      • unique_session_id: Directly copied
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[session_id]
    • Integration Used to create the unique_session_id by concatenating with user_id
    • Output Columns:
      • unique_session_id: Concatenated with user_id to form unique_session_id
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_id]
    • Direct Copied without transformation
    • Integration Used to create the unique_session_id by concatenating with session_id
    • Aggregation Used in GROUP BY clause for session aggregation
    • Deduplication Used in window functions for session ranking and lag calculations
    • Output Columns:
      • user_id: Directly copied
      • unique_session_id: Concatenated with session_id to form unique_session_id
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_session_id]
    • Integration Used to join the event_enhanced and session_data tables
    • Aggregation Used to count distinct sessions per user
    • Output Columns:
      • total_sessions_per_user: Aggregated as COUNT(DISTINCT unique_session_id)
  • Input Column: 3. model.amplitude.amplitude__sessions[unique_session_id]
    • Integration Used as the key to join with event_enhanced table
    • Aggregation Used in COUNT(DISTINCT) to calculate total_sessions_per_user
    • Output Columns:
      • total_sessions_per_user: Counted distinctly to get the total number of sessions per user
Column Lineage
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced minutes_in_between_sessions 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced average_minutes_in_between_sessions 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions minutes_in_between_sessions 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions:f0->4. model.amplitude.amplitude__user_enhanced:f0
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[minutes_in_between_sessions]
    • Direct This column is directly copied from the input to the output without any transformation.
    • Output Columns:
      • minutes_in_between_sessions: Directly copied to the output column with the same name.
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[minutes_in_between_sessions]
    • Aggregation This column is used in the AVG() function to calculate the average time between sessions for each user.
    • Output Columns:
      • average_minutes_in_between_sessions: The average value of this column is calculated for each user.
  • Input Column: 3. model.amplitude.amplitude__sessions[minutes_in_between_sessions]
    • Aggregation This column is used in the AVG function to calculate the average minutes between sessions.
    • Output Columns:
      • average_minutes_in_between_sessions: The average is calculated from this column.
Column Lineage
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_length_in_minutes 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced average_session_length_in_minutes 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_ended_at session_length session_length_in_minutes session_started_at 3. model.amplitude.amplitude__sessions:f2->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions:f1->4. model.amplitude.amplitude__user_enhanced:f0 3. model.amplitude.amplitude__sessions:f2->4. model.amplitude.amplitude__user_enhanced:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_event_time unique_event_id 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f2 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create unique_event_id
    • Output Columns:
      • client_event_time: Directly copied after casting to TIMESTAMP
      • unique_event_id: Part of the MD5 hash to create this column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_length_in_minutes]
    • Direct This column is directly copied from the input to the output without any transformation.
    • Output Columns:
      • session_length_in_minutes: Directly copied to the output column with the same name.
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_event_time]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Aggregation Used to determine session start and end times
    • Output Columns:
      • session_started_at: Minimum client_event_time for a session
      • session_ended_at: Maximum client_event_time for a session
      • session_length_in_minutes: Calculated from the difference between max and min client_event_time
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_length_in_minutes]
    • Aggregation This column is used in the AVG() function to calculate the average session length for each user.
    • Output Columns:
      • average_session_length_in_minutes: The average value of this column is calculated for each user.
  • Input Column: 3. model.amplitude.amplitude__sessions[session_length]
    • Aggregation Used in AVG calculation for average session length
    • Output Columns:
      • average_session_length_in_minutes: Averaged to get the mean session length in minutes
  • Input Column: 3. model.amplitude.amplitude__sessions[session_length_in_minutes]
    • Aggregation This column is used in the AVG function to calculate the average session length in minutes.
    • Output Columns:
      • average_session_length_in_minutes: The average is calculated from this column.
5. model.amplitude.int_amplitude__date_spine

This SQL query creates a date spine (a continuous series of dates) for each event type in the amplitude__event_enhanced table. It generates dates from 2020-01-01 to 2024-08-01, then joins this with the event data to create a record for each event type on every day since its first occurrence. The query also generates a unique key for each date-event type combination.

IntegrationFeaturizationOther
SQL Query
WITH event_data AS (
  SELECT
    *
  FROM TEST.PUBLIC_amplitude.amplitude__event_enhanced
), spine /* create end_date_adjust variable */ AS (
  SELECT
    spine.*
  FROM (
    WITH rawdata AS (
      WITH p AS (
        SELECT
          0 AS generated_number
        UNION ALL
        SELECT
          1
      ), unioned AS (
        SELECT
          p0.generated_number * POWER(2, 0) + p1.generated_number * POWER(2, 1) + p2.generated_number * POWER(2, 2) + p3.generated_number * POWER(2, 3) + p4.generated_number * POWER(2, 4) + p5.generated_number * POWER(2, 5) + p6.generated_number * POWER(2, 6) + p7.generated_number * POWER(2, 7) + p8.generated_number * POWER(2, 8) + p9.generated_number * POWER(2, 9) + p10.generated_number * POWER(2, 10) + 1 AS generated_number
        FROM p AS p0
        CROSS JOIN p AS p1
        CROSS JOIN p AS p2
        CROSS JOIN p AS p3
        CROSS JOIN p AS p4
        CROSS JOIN p AS p5
        CROSS JOIN p AS p6
        CROSS JOIN p AS p7
        CROSS JOIN p AS p8
        CROSS JOIN p AS p9
        CROSS JOIN p AS p10
      )
      SELECT
        *
      FROM unioned
      WHERE
        generated_number <= 1674
      ORDER BY
        generated_number
    ), all_periods AS (
      SELECT
        (
          DATEADD(day, ROW_NUMBER() OVER (ORDER BY 1) - 1, CAST('2020-01-01' AS DATE))
        ) AS date_day
      FROM rawdata
    ), filtered AS (
      SELECT
        *
      FROM all_periods
      WHERE
        date_day <= CAST('2024-08-01' AS DATE)
    )
    SELECT
      *
    FROM filtered
  ) AS spine
), date_spine AS (
  SELECT DISTINCT
    event_data.event_type,
    CAST(spine.date_day AS DATE) AS event_day,
    MD5(
      CAST(COALESCE(CAST(spine.date_day AS TEXT), '_dbt_utils_surrogate_key_null_') || '-' || COALESCE(CAST(event_data.event_type AS TEXT), '_dbt_utils_surrogate_key_null_') AS TEXT)
    ) AS date_spine_unique_key
  FROM spine
  JOIN event_data
    ON spine.date_day >= event_data.event_day /* each event_type will have a record for every day since their first day */
)
SELECT
  *
FROM date_spine
%3 5. model.amplitude.int_amplitude__date_spine 5. model.amplitude.int_amplitude__date_spine event_type event_day date_spine_unique_key 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_type event_day event_type_name 2. model.amplitude.amplitude__event_enhanced:f0->5. model.amplitude.int_amplitude__date_spine:f0 2. model.amplitude.amplitude__event_enhanced:f1->5. model.amplitude.int_amplitude__date_spine:f1 2. model.amplitude.amplitude__event_enhanced:f2->5. model.amplitude.int_amplitude__date_spine:f0
Name Type Comment
event_type text None
event_day date None
date_spine_unique_key text None
Column Lineage
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_type event_type_name 5. model.amplitude.int_amplitude__date_spine 5. model.amplitude.int_amplitude__date_spine event_type 2. model.amplitude.amplitude__event_enhanced:f0->5. model.amplitude.int_amplitude__date_spine:f0 2. model.amplitude.amplitude__event_enhanced:f1->5. model.amplitude.int_amplitude__date_spine:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance event_type 5. model.amplitude.int_amplitude__date_spine:f0->1. model.amplitude.amplitude__daily_performance:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_type 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type event_type_name 8. model.amplitude_source.stg_amplitude__event_type:f0->2. model.amplitude.amplitude__event_enhanced:f1 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_type 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp name 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • event_type: Directly copied
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • event_type_name: Directly mapped to this output column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_type]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with event_type table
    • Output Columns:
      • event_type: Directly copied
  • Input Column: 8. model.amplitude_source.stg_amplitude__event_type[event_type_name]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with event_data
    • Output Columns:
      • event_type_name: Directly mapped
5. model.amplitude.int_amplitude__date_spine
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_type]
    • Direct The event_type is directly selected from the event_data CTE
    • Integration Used to join with the spine CTE to create a record for each event type on every day
    • Output Columns:
      • event_type: Directly mapped to the output column
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_type_name]
    • Integration Used to join with the spine table to create records for each event type
    • Output Columns:
      • event_type: Likely mapped directly to this output column
1. model.amplitude.amplitude__daily_performance
  • Input Column: 5. model.amplitude.int_amplitude__date_spine[event_type]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the agg_event_data CTE
    • Aggregation The column is grouped by in the agg_event_data CTE
    • Output Columns:
      • event_type: Directly mapped to the output column
Column Lineage
%3 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_day 5. model.amplitude.int_amplitude__date_spine 5. model.amplitude.int_amplitude__date_spine event_day 2. model.amplitude.amplitude__event_enhanced:f0->5. model.amplitude.int_amplitude__date_spine:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance event_day 5. model.amplitude.int_amplitude__date_spine:f0->1. model.amplitude.amplitude__daily_performance:f0 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_day event_time 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create event_day
    • Filtering Used to filter records based on date range
    • Output Columns:
      • event_time: Directly copied after casting
      • event_day: Derived from event_time
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_day]
    • Direct The column is directly copied without any transformation
    • Other Used in the unique_key generation
    • Output Columns:
      • event_day: Directly copied
5. model.amplitude.int_amplitude__date_spine
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_day]
    • Integration Used to join with the spine CTE to ensure each event_type has a record for every day since their first day
    • Featurization Used to create the event_day column in the output
    • Output Columns:
      • event_day: Transformed from the spine.date_day and used as the output column
1. model.amplitude.amplitude__daily_performance
  • Input Column: 5. model.amplitude.int_amplitude__date_spine[event_day]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the agg_event_data CTE
    • Aggregation The column is grouped by in the agg_event_data CTE
    • Output Columns:
      • event_day: Directly mapped to the output column
6. model.amplitude_source.stg_amplitude__event

This SQL query processes data from an Amplitude event source. It performs several transformations including casting data types, creating derived columns (like event_day and unique_session_id), and applying filters based on event time. The query also generates a unique event ID using an MD5 hash of multiple fields. It selects a wide range of columns, some directly from the source and others with modifications or as newly calculated fields.

FilteringCleaningFeaturizationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC__source_amplitude.stg_amplitude__event_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS _insert_id,
    CAST(NULL AS TEXT) AS ad_id,
    CAST(NULL AS TEXT) AS amplitude_id,
    CAST(NULL AS TEXT) AS app,
    CAST(NULL AS TEXT) AS city,
    CAST(NULL AS TIMESTAMP) AS client_event_time,
    CAST(NULL AS TIMESTAMP) AS client_upload_time,
    CAST(NULL AS TEXT) AS country,
    CAST(NULL AS TEXT) AS data,
    CAST(NULL AS TEXT) AS device_brand,
    CAST(NULL AS TEXT) AS device_carrier,
    CAST(NULL AS TEXT) AS device_family,
    CAST(NULL AS TEXT) AS device_id,
    CAST(NULL AS TEXT) AS device_manufacturer,
    CAST(NULL AS TEXT) AS device_model,
    CAST(NULL AS TEXT) AS device_type,
    CAST(NULL AS TEXT) AS dma,
    CAST(NULL AS TEXT) AS event_properties,
    CAST(NULL AS TIMESTAMP) AS event_time,
    CAST(NULL AS TEXT) AS event_type,
    CAST(NULL AS INT) AS event_type_id,
    CAST(NULL AS TEXT) AS group_properties,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TEXT) AS idfa,
    CAST(NULL AS TEXT) AS ip_address,
    CAST(NULL AS BOOLEAN) AS is_attribution_event,
    CAST(NULL AS TEXT) AS language,
    CAST(NULL AS TEXT) AS library,
    CAST(NULL AS TEXT) AS location_lat,
    CAST(NULL AS TEXT) AS location_lng,
    CAST(NULL AS TEXT) AS os_name,
    CAST(NULL AS TEXT) AS os_version,
    CAST(NULL AS BOOLEAN) AS paying,
    CAST(NULL AS TEXT) AS platform,
    CAST(NULL AS TIMESTAMP) AS processed_time,
    CAST(NULL AS TEXT) AS project_name,
    CAST(NULL AS TEXT) AS region,
    CAST(NULL AS INT) AS schema,
    CAST(NULL AS TIMESTAMP) AS server_received_time,
    CAST(NULL AS TIMESTAMP) AS server_upload_time,
    CAST(NULL AS INT) AS session_id,
    CAST(NULL AS TEXT) AS start_version,
    CAST(NULL AS TIMESTAMP) AS user_creation_time,
    CAST(NULL AS TEXT) AS user_id,
    CAST(NULL AS TEXT) AS user_properties,
    CAST(NULL AS TEXT) AS uuid,
    CAST(NULL AS TEXT) AS version_name,
    CAST(NULL AS TEXT) AS group_types
  FROM base
), final AS (
  SELECT
    id AS event_id,
    CAST(event_time AS TIMESTAMP) AS event_time,
    CAST(DATE_TRUNC('DAY', event_time) AS DATE) AS event_day,
    MD5(
      CAST(COALESCE(CAST(user_id AS TEXT), '_dbt_utils_surrogate_key_null_') || '-' || COALESCE(CAST(session_id AS TEXT), '_dbt_utils_surrogate_key_null_') AS TEXT)
    ) AS unique_session_id,
    COALESCE(CAST(user_id AS TEXT), (
      CAST(amplitude_id AS TEXT)
    )) AS amplitude_user_id,
    event_properties,
    event_type,
    event_type_id,
    group_types,
    group_properties,
    session_id,
    CAST(user_id AS TEXT) AS user_id,
    user_properties,
    CAST(amplitude_id AS TEXT) AS amplitude_id,
    _insert_id,
    ad_id,
    app,
    project_name,
    CAST(client_event_time AS TIMESTAMP) AS client_event_time,
    CAST(client_upload_time AS TIMESTAMP) AS client_upload_time,
    city,
    country,
    data,
    device_brand,
    device_carrier,
    device_family,
    device_id,
    device_manufacturer,
    device_model,
    device_type,
    dma,
    idfa,
    ip_address,
    language,
    location_lat,
    location_lng,
    os_name,
    os_version,
    is_attribution_event,
    library,
    paying AS is_paying,
    platform,
    CAST(processed_time AS TIMESTAMP) AS processed_time,
    region,
    schema,
    CAST(server_received_time AS TIMESTAMP) AS server_received_time,
    CAST(server_upload_time AS TIMESTAMP) AS server_upload_time,
    start_version,
    CAST(user_creation_time AS TIMESTAMP) AS user_creation_time,
    uuid,
    version_name,
    _fivetran_synced
  FROM fields
  WHERE
    CAST(DATE_TRUNC('DAY', event_time) AS DATE) >= CAST('2020-01-01' AS DATE) /* filter to records past a specific date */
    AND CAST(DATE_TRUNC('DAY', event_time) AS DATE) <= CAST(DATEADD(month, 1, DATE_TRUNC('DAY', CAST(CURRENT_TIMESTAMP() AS TIMESTAMP))) AS DATE) /* filter to records before a specific date */
), surrogate AS (
  SELECT
    *,
    MD5(
      CAST(COALESCE(CAST(event_id AS TEXT), '_dbt_utils_surrogate_key_null_') || '-' || COALESCE(CAST(device_id AS TEXT), '_dbt_utils_surrogate_key_null_') || '-' || COALESCE(CAST(client_event_time AS TEXT), '_dbt_utils_surrogate_key_null_') || '-' || COALESCE(CAST(amplitude_user_id AS TEXT), '_dbt_utils_surrogate_key_null_') AS TEXT)
    ) AS unique_event_id
  FROM final
)
SELECT
  *
FROM surrogate
%3 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event unique_event_id event_id unique_session_id amplitude_id amplitude_user_id ad_id app city client_event_time client_upload_time country data device_brand device_carrier device_family device_id device_manufacturer device_model device_type dma event_properties event_time event_day event_type event_type_id group_properties group_types idfa _insert_id ip_address is_attribution_event language library location_lat location_lng os_name os_version is_paying platform processed_time project_name region schema server_received_time server_upload_time session_id start_version user_creation_time user_id user_properties uuid version_name _fivetran_synced 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_id id server_upload_time _fivetran_synced _insert_id ad_id amplitude_id app city client_event_time client_upload_time country data device_brand device_carrier device_family device_manufacturer device_model device_type dma event_properties event_time event_type event_type_id group_properties groups idfa ip_address is_attribution_event language library location_lat location_lng os_name os_version paying platform processed_time project_name region schema server_received_time session_id start_version user_creation_time user_id user_properties uuid version_name 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f15 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f2->6. model.amplitude_source.stg_amplitude__event:f44 7. model.amplitude_source.stg_amplitude__event_tmp:f3->6. model.amplitude_source.stg_amplitude__event:f52 7. model.amplitude_source.stg_amplitude__event_tmp:f4->6. model.amplitude_source.stg_amplitude__event:f28 7. model.amplitude_source.stg_amplitude__event_tmp:f5->6. model.amplitude_source.stg_amplitude__event:f5 7. model.amplitude_source.stg_amplitude__event_tmp:f6->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f6->6. model.amplitude_source.stg_amplitude__event:f4 7. model.amplitude_source.stg_amplitude__event_tmp:f7->6. model.amplitude_source.stg_amplitude__event:f6 7. model.amplitude_source.stg_amplitude__event_tmp:f8->6. model.amplitude_source.stg_amplitude__event:f7 7. model.amplitude_source.stg_amplitude__event_tmp:f9->6. model.amplitude_source.stg_amplitude__event:f8 7. model.amplitude_source.stg_amplitude__event_tmp:f9->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f10->6. model.amplitude_source.stg_amplitude__event:f9 7. model.amplitude_source.stg_amplitude__event_tmp:f11->6. model.amplitude_source.stg_amplitude__event:f10 7. model.amplitude_source.stg_amplitude__event_tmp:f12->6. model.amplitude_source.stg_amplitude__event:f11 7. model.amplitude_source.stg_amplitude__event_tmp:f13->6. model.amplitude_source.stg_amplitude__event:f12 7. model.amplitude_source.stg_amplitude__event_tmp:f14->6. model.amplitude_source.stg_amplitude__event:f13 7. model.amplitude_source.stg_amplitude__event_tmp:f15->6. model.amplitude_source.stg_amplitude__event:f14 7. model.amplitude_source.stg_amplitude__event_tmp:f16->6. model.amplitude_source.stg_amplitude__event:f16 7. model.amplitude_source.stg_amplitude__event_tmp:f17->6. model.amplitude_source.stg_amplitude__event:f17 7. model.amplitude_source.stg_amplitude__event_tmp:f18->6. model.amplitude_source.stg_amplitude__event:f18 7. model.amplitude_source.stg_amplitude__event_tmp:f19->6. model.amplitude_source.stg_amplitude__event:f19 7. model.amplitude_source.stg_amplitude__event_tmp:f20->6. model.amplitude_source.stg_amplitude__event:f20 7. model.amplitude_source.stg_amplitude__event_tmp:f21->6. model.amplitude_source.stg_amplitude__event:f21 7. model.amplitude_source.stg_amplitude__event_tmp:f21->6. model.amplitude_source.stg_amplitude__event:f22 7. model.amplitude_source.stg_amplitude__event_tmp:f22->6. model.amplitude_source.stg_amplitude__event:f23 7. model.amplitude_source.stg_amplitude__event_tmp:f23->6. model.amplitude_source.stg_amplitude__event:f24 7. model.amplitude_source.stg_amplitude__event_tmp:f24->6. model.amplitude_source.stg_amplitude__event:f25 7. model.amplitude_source.stg_amplitude__event_tmp:f25->6. model.amplitude_source.stg_amplitude__event:f26 7. model.amplitude_source.stg_amplitude__event_tmp:f26->6. model.amplitude_source.stg_amplitude__event:f27 7. model.amplitude_source.stg_amplitude__event_tmp:f27->6. model.amplitude_source.stg_amplitude__event:f29 7. model.amplitude_source.stg_amplitude__event_tmp:f28->6. model.amplitude_source.stg_amplitude__event:f30 7. model.amplitude_source.stg_amplitude__event_tmp:f29->6. model.amplitude_source.stg_amplitude__event:f31 7. model.amplitude_source.stg_amplitude__event_tmp:f30->6. model.amplitude_source.stg_amplitude__event:f32 7. model.amplitude_source.stg_amplitude__event_tmp:f31->6. model.amplitude_source.stg_amplitude__event:f33 7. model.amplitude_source.stg_amplitude__event_tmp:f32->6. model.amplitude_source.stg_amplitude__event:f34 7. model.amplitude_source.stg_amplitude__event_tmp:f33->6. model.amplitude_source.stg_amplitude__event:f35 7. model.amplitude_source.stg_amplitude__event_tmp:f34->6. model.amplitude_source.stg_amplitude__event:f36 7. model.amplitude_source.stg_amplitude__event_tmp:f35->6. model.amplitude_source.stg_amplitude__event:f37 7. model.amplitude_source.stg_amplitude__event_tmp:f36->6. model.amplitude_source.stg_amplitude__event:f38 7. model.amplitude_source.stg_amplitude__event_tmp:f37->6. model.amplitude_source.stg_amplitude__event:f39 7. model.amplitude_source.stg_amplitude__event_tmp:f38->6. model.amplitude_source.stg_amplitude__event:f40 7. model.amplitude_source.stg_amplitude__event_tmp:f39->6. model.amplitude_source.stg_amplitude__event:f41 7. model.amplitude_source.stg_amplitude__event_tmp:f40->6. model.amplitude_source.stg_amplitude__event:f42 7. model.amplitude_source.stg_amplitude__event_tmp:f41->6. model.amplitude_source.stg_amplitude__event:f43 7. model.amplitude_source.stg_amplitude__event_tmp:f42->6. model.amplitude_source.stg_amplitude__event:f45 7. model.amplitude_source.stg_amplitude__event_tmp:f42->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f43->6. model.amplitude_source.stg_amplitude__event:f46 7. model.amplitude_source.stg_amplitude__event_tmp:f44->6. model.amplitude_source.stg_amplitude__event:f47 7. model.amplitude_source.stg_amplitude__event_tmp:f45->6. model.amplitude_source.stg_amplitude__event:f48 7. model.amplitude_source.stg_amplitude__event_tmp:f45->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f45->6. model.amplitude_source.stg_amplitude__event:f4 7. model.amplitude_source.stg_amplitude__event_tmp:f46->6. model.amplitude_source.stg_amplitude__event:f49 7. model.amplitude_source.stg_amplitude__event_tmp:f47->6. model.amplitude_source.stg_amplitude__event:f50 7. model.amplitude_source.stg_amplitude__event_tmp:f48->6. model.amplitude_source.stg_amplitude__event:f51
Name Type Comment
unique_event_id text A unique key for each event, concatenating event_id, device_id, client_event_time, and amplitude_user_id.
event_id bigint A counter that distinguishes events.
unique_session_id text A unique key for each session, concatenating user_id and session_id.
amplitude_id text An internal ID used to identify unique users.
amplitude_user_id text Unique key for each user, which is user_id by default. If user_id does not exist, the package will use amplitude_id.
ad_id integer (Android) Google Play Services advertising ID (AdID). This usually is wiped after ingestion and therefore will be blank.
app bigint Project ID found in your project's Settings page.
city integer City where the event was registered.
client_event_time timestamp without time zone Local timestamp (UTC) of when the device logged the event.
client_upload_time timestamp without time zone The local timestamp (UTC) of when the device uploaded the event.
country text Country where event was registered.
data text Dictionary where certain fields such as first_event and merged_amplitude_id are stored. Ex, {"first_event":true}.
device_brand integer Brand of device where event was registered on.
device_carrier integer Carrier of device where event was registered on.
device_family integer Device family. Ex, Apple iPhone.
device_id text The device specific identifier.
device_manufacturer integer Manufacturer of device where event was registered on.
device_model integer The model of device where event was registered on.
device_type integer Type of device where event was registered on.
dma integer Designated marketing area (DMA).
event_properties text Event properties are attributes of the events your users fire, and which you then send to Amplitude. Each event will have its own set of event properties. The nature of these properties depends on both the type of product you have, and the specific information you're most interested in discovering. For instance, if Swipe is an event you're tracking, the event property Direction could have the values Left or Right. Some example event properties are description, category, type, duration, level, percent completed, count, source, status, number, lives, authenticated, error number, rank, action, and mode.
event_time timestamp without time zone Amplitude timestamp (UTC) which is the client_event_time adjusted by the difference between server_received_time and client_upload_time, specifically: event_time = client_event_time + (server_received_time - client_upload_time) 2015-08-10T12:00:00.000000 We use this timestamp to organize events on Amplitude charts. Note: If the difference between server_received_time and client_upload_time is less than 60 seconds, the event_time will not be adjusted and will equal the client_event_time.
event_day date The day of the event time, in date format.
event_type text The assigned type of event. Example 'Add Friend'
event_type_id bigint Internal identifier on Amplitude.
group_properties text A dictionary of key-value pairs that represent data tied to the group. Each distinct value appears as a group segment on the Amplitude dashboard. You can store property values in an array, and date values are transformed into string values.
group_types text Group types. "Groups" in the source table, renamed here. See the [Accounts documentation](https://help.amplitude.com/hc/en-us/articles/115001765532-Accounts) for more information.
idfa integer (iOS) Identifier for Advertiser. This usually is wiped after ingestion and therefore will be blank.
_insert_id integer A unique identifier for the event. Amplitude deduplicates subsequent events sent with the same device_id and insert_id within the past 7 days. Amplitude recommends generating a UUID or using some combination of device_id, user_id, event_type, event_id, and time.
ip_address text The IP address of the device which triggered the event.
is_attribution_event boolean Boolean of boolean of whether event was an attribution event.
language integer The language set by the user.
library text Library being used to send the event data.
location_lat integer Latitude where event was registered.
location_lng integer Longitude where event was registered.
os_name integer OS name where event was registered on.
os_version integer OS version where event was registered on.
is_paying integer Boolean of boolean of whether the user has ever logged any revenue, otherwise '(none)'. Note the property value can be modified via the\_Identify API.
platform integer Platform of the device where event was registered on.
processed_time timestamp without time zone Time of when event was processed.
project_name bigint The identifier of the project.
region integer Region where event was registered on.
schema bigint The schema ID.
server_received_time timestamp without time zone Amplitude timestamp (UTC) of when servers received the event.
server_upload_time timestamp without time zone Amplitude timestamp (UTC) of when the event data was uploaded to Amplitude servers.
session_id bigint The session start time in milliseconds since epoch.
start_version integer App version the user was first tracked on.
user_creation_time timestamp without time zone Event_time (UTC) of the user's first event.
user_id text A readable ID specified by you. Amplitude uses a combination of three different methods to identify your users: device IDs, Amplitude ID, and user IDs. The first comes directly from your users' devices, while the second is an ID that Amplitude automatically creates once it has enough information to conclusively identify a unique user. The user ID, however, is something you'd set up. In Amplitude, a user ID is a unique identifier applied to individual users. Using them is optional, but recommended: your product should set a user ID once a user has created an account, logged in, or is otherwise identified in your product. Amplitude can use a user ID to reconcile events across multiple devices under the same user ID. Additionally, a user's event data will be merged on the backend so that all anonymous events prior to the assignment of a user ID will be connected to the correct user. For this reason, you can wait to assign user IDs if that makes sense for your product. Conversely, this is also why you should not set user IDs for anonymous users. Once set, user IDs in Amplitude cannot be changed.Once set, user IDs in Amplitude cannot be changed.
user_properties text An attribute that describes a useful detail about the user it's attached to. Amplitude sends user properties with every event.
uuid text A unique identifier per row (event sent).
version_name integer The app version name.
_fivetran_synced timestamp without time zone Timestamp of when Fivetran synced a record.
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_event_time device_id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_event_time device_id unique_event_id 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f2 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced unique_event_id 6. model.amplitude_source.stg_amplitude__event:f2->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:header 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced total_events_per_user 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_events 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Other Used in the MD5 hash to create unique_event_id
    • Output Columns:
      • device_id: Directly mapped
      • unique_event_id: Part of the MD5 hash
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create unique_event_id
    • Output Columns:
      • client_event_time: Directly copied after casting to TIMESTAMP
      • unique_event_id: Part of the MD5 hash to create this column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_event_id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Output Columns:
      • unique_event_id: Directly copied
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_event_id]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_event_id]
    • Aggregation Used in COUNT(DISTINCT unique_event_id) to calculate number_events
    • Output Columns:
      • number_events: Aggregated to count distinct events
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_event_id]
    • Aggregation Used to count distinct events per user
    • Output Columns:
      • total_events_per_user: Aggregated as COUNT(DISTINCT unique_event_id)
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_id events_per_session 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions events_per_session 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f0 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[id]
    • Cleaning The column is cast as INT
    • Output Columns:
      • event_id: Directly mapped after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[events_per_session]
    • Direct directly copied to the output
    • Output Columns:
      • events_per_session: directly copied
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_id]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Aggregation Counted to calculate events_per_session
    • Output Columns:
      • events_per_session: Aggregated count of event_id
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp session_id user_id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event amplitude_user_id session_id unique_session_id user_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced unique_session_id 6. model.amplitude_source.stg_amplitude__event:f2->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions unique_session_id 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced total_sessions_per_user 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_sessions 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions:f0->4. model.amplitude.amplitude__user_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[session_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Other Used in creating the unique_session_id
    • Output Columns:
      • session_id: Directly mapped
      • unique_session_id: Part of MD5 hash with user_id
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[unique_session_id]
    • Integration used as the key to join session_data with event_data
    • Direct directly copied to the output
    • Output Columns:
      • unique_session_id: directly copied
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_session_id]
    • Direct Directly used in the output
    • Aggregation Used as a grouping key
    • Output Columns:
      • unique_session_id: Directly copied
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_session_id]
    • Aggregation Used in COUNT(DISTINCT unique_session_id) to calculate number_sessions
    • Output Columns:
      • number_sessions: Aggregated to count distinct sessions
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_session_id]
    • Integration Used to join the event_enhanced and session_data tables
    • Aggregation Used to count distinct sessions per user
    • Output Columns:
      • total_sessions_per_user: Aggregated as COUNT(DISTINCT unique_session_id)
  • Input Column: 3. model.amplitude.amplitude__sessions[unique_session_id]
    • Integration Used as the key to join with event_enhanced table
    • Aggregation Used in COUNT(DISTINCT) to calculate total_sessions_per_user
    • Output Columns:
      • total_sessions_per_user: Counted distinctly to get the total number of sessions per user
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp amplitude_id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event amplitude_id amplitude_user_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced amplitude_id 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[amplitude_id]
    • Cleaning The column is cast as TEXT
    • Other Used as a fallback for amplitude_user_id when user_id is null
    • Output Columns:
      • amplitude_id: Directly mapped after casting
      • amplitude_user_id: Used as fallback when user_id is null
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[amplitude_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • amplitude_id: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp amplitude_id user_id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event amplitude_id amplitude_user_id unique_session_id user_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f3 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f1->6. model.amplitude_source.stg_amplitude__event:f1 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced amplitude_user_id 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:header 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced amplitude_user_id 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_new_users number_users 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f1 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[amplitude_id]
    • Cleaning The column is cast as TEXT
    • Other Used as a fallback for amplitude_user_id when user_id is null
    • Output Columns:
      • amplitude_id: Directly mapped after casting
      • amplitude_user_id: Used as fallback when user_id is null
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[amplitude_user_id]
    • Direct The column is directly copied without any transformation
    • Cleaning Cast as TEXT
    • Featurization Used to generate user_event_number
    • Output Columns:
      • amplitude_user_id: Directly copied after casting to TEXT
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[amplitude_user_id]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[amplitude_user_id]
    • Aggregation Used in COUNT(DISTINCT amplitude_user_id) to calculate number_users and number_new_users
    • Output Columns:
      • number_users: Aggregated to count distinct users
      • number_new_users: Aggregated to count distinct new users
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[amplitude_user_id]
    • Integration Used as the key to join the event_enhanced and session_data tables
    • Aggregation Used as the grouping key for all aggregations
    • Output Columns:
      • amplitude_user_id: Directly copied to the output
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp ad_id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event ad_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[ad_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_id: Directly mapped
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp app 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event app 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced app 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[app]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • app: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[app]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • app: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp city 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event city 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced city 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[city]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • city: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[city]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • city: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_event_time 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_event_time unique_event_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced client_event_time session_ended_at session_length_in_minutes session_started_at 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_ended_at session_length_in_minutes session_started_at 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f2 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f1 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance event_day 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced average_session_length_in_minutes first_session_at last_session_at 2. model.amplitude.amplitude__event_enhanced:f3->4. model.amplitude.amplitude__user_enhanced:f1 2. model.amplitude.amplitude__event_enhanced:f1->4. model.amplitude.amplitude__user_enhanced:f2 2. model.amplitude.amplitude__event_enhanced:f2->4. model.amplitude.amplitude__user_enhanced:f0 3. model.amplitude.amplitude__sessions:f2->2. model.amplitude.amplitude__event_enhanced:f3 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f1 3. model.amplitude.amplitude__sessions:f1->2. model.amplitude.amplitude__event_enhanced:f2 3. model.amplitude.amplitude__sessions:f1->4. model.amplitude.amplitude__user_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create unique_event_id
    • Output Columns:
      • client_event_time: Directly copied after casting to TIMESTAMP
      • unique_event_id: Part of the MD5 hash to create this column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_started_at]
    • Direct directly copied to the output
    • Output Columns:
      • session_started_at: directly copied
  • Input Column: 3. model.amplitude.amplitude__sessions[session_ended_at]
    • Direct directly copied to the output
    • Output Columns:
      • session_ended_at: directly copied
  • Input Column: 3. model.amplitude.amplitude__sessions[session_length_in_minutes]
    • Direct This column is directly copied from the input to the output without any transformation.
    • Output Columns:
      • session_length_in_minutes: Directly copied to the output column with the same name.
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_event_time]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Aggregation Used to determine session start and end times
    • Output Columns:
      • session_started_at: Minimum client_event_time for a session
      • session_ended_at: Maximum client_event_time for a session
      • session_length_in_minutes: Calculated from the difference between max and min client_event_time
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[client_event_time]
    • Aggregation Used to determine the event day for grouping
    • Output Columns:
      • event_day: Derived from DATE_TRUNC('DAY', client_event_time)
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_started_at]
    • Aggregation Used in MIN function to find first session
    • Output Columns:
      • first_session_at: Aggregated to find the earliest session start
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_ended_at]
    • Aggregation Used in MAX function to find last session
    • Output Columns:
      • last_session_at: Aggregated to find the latest session end
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_length_in_minutes]
    • Aggregation This column is used in the AVG() function to calculate the average session length for each user.
    • Output Columns:
      • average_session_length_in_minutes: The average value of this column is calculated for each user.
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_upload_time 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_upload_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced client_upload_time 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:header
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_upload_time]
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • client_upload_time: Directly copied after casting to TIMESTAMP
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_upload_time]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ORDER BY clause of the ROW_NUMBER() function for deduplication
    • Output Columns:
      • client_upload_time: Directly copied
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_upload_time]
    • Deduplication Used in the ORDER BY clause of ROW_NUMBER() function for deduplication
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp country 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event country 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced country 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[country]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • country: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[country]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • country: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp data 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event data 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced data 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[data]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • data: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[data]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • data: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_brand 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_brand 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_brand 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_brand]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_brand: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_brand]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_brand: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_carrier 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_carrier 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_carrier 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_carrier]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_carrier: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_carrier]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_carrier: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_family 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_family 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_family 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_family]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_family: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_family]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_family: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_id unique_event_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_id 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:header
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Other Used in the MD5 hash to create unique_event_id
    • Output Columns:
      • device_id: Directly mapped
      • unique_event_id: Part of the MD5 hash
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the PARTITION BY clause for deduplication when _insert_id is NULL
    • Output Columns:
      • device_id: Directly copied
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_id]
    • Deduplication Used in the deduplication process when _insert_id is null
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_manufacturer 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_manufacturer 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_manufacturer 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_manufacturer]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_manufacturer: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_manufacturer]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_manufacturer: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_model 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_model 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_model 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_model]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_model: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_model]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_model: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_type 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_type 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_type 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_type: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_type: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp dma 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event dma 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced dma 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[dma]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • dma: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[dma]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • dma: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_properties 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_properties 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_properties]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • event_properties: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_time 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_day event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_time session_ended_at session_ended_at_day session_started_at session_started_at_day 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_ended_at session_ended_at_day session_started_at session_started_at_day 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f2 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f1 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced first_session_at last_session_at 2. model.amplitude.amplitude__event_enhanced:f3->4. model.amplitude.amplitude__user_enhanced:f0 2. model.amplitude.amplitude__event_enhanced:f1->4. model.amplitude.amplitude__user_enhanced:f1 2. model.amplitude.amplitude__event_enhanced:f4->4. model.amplitude.amplitude__user_enhanced:f0 2. model.amplitude.amplitude__event_enhanced:f2->4. model.amplitude.amplitude__user_enhanced:f1 3. model.amplitude.amplitude__sessions:f2->2. model.amplitude.amplitude__event_enhanced:f3 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f1 3. model.amplitude.amplitude__sessions:f3->2. model.amplitude.amplitude__event_enhanced:f4 3. model.amplitude.amplitude__sessions:f1->2. model.amplitude.amplitude__event_enhanced:f2
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create event_day
    • Filtering Used to filter records based on date range
    • Output Columns:
      • event_time: Directly copied after casting
      • event_day: Derived from event_time
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_started_at]
    • Direct directly copied to the output
    • Output Columns:
      • session_started_at: directly copied
  • Input Column: 3. model.amplitude.amplitude__sessions[session_ended_at]
    • Direct directly copied to the output
    • Output Columns:
      • session_ended_at: directly copied
  • Input Column: 3. model.amplitude.amplitude__sessions[session_started_at_day]
    • Direct directly copied to the output
    • Output Columns:
      • session_started_at_day: directly copied
  • Input Column: 3. model.amplitude.amplitude__sessions[session_ended_at_day]
    • Direct directly copied to the output
    • Output Columns:
      • session_ended_at_day: directly copied
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_time]
    • Aggregation Used to determine session start and end times
    • Cleaning Truncated to day for session_started_at_day and session_ended_at_day
    • Output Columns:
      • session_started_at: Minimum event_time for a session
      • session_ended_at: Maximum event_time for a session
      • session_started_at_day: Truncated event_time to day for session start
      • session_ended_at_day: Truncated event_time to day for session end
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_started_at]
    • Aggregation Used in MIN function to find first session
    • Output Columns:
      • first_session_at: Aggregated to find the earliest session start
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_ended_at]
    • Aggregation Used in MAX function to find last session
    • Output Columns:
      • last_session_at: Aggregated to find the latest session end
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_started_at_day]
    • Aggregation This column is used in the MIN() function to determine the first session date for each user.
    • Output Columns:
      • first_session_at: The minimum value of this column is used to determine the first session timestamp for each user.
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_ended_at_day]
    • Aggregation This column is used in the MAX() function to determine the last session date for each user.
    • Output Columns:
      • last_session_at: The maximum value of this column is used to determine the last session timestamp for each user.
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_time 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_day event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_day 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 5. model.amplitude.int_amplitude__date_spine 5. model.amplitude.int_amplitude__date_spine event_day 2. model.amplitude.amplitude__event_enhanced:f0->5. model.amplitude.int_amplitude__date_spine:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance event_day 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 5. model.amplitude.int_amplitude__date_spine:f0->1. model.amplitude.amplitude__daily_performance:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create event_day
    • Filtering Used to filter records based on date range
    • Output Columns:
      • event_time: Directly copied after casting
      • event_day: Derived from event_time
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_day]
    • Direct The column is directly copied without any transformation
    • Other Used in the unique_key generation
    • Output Columns:
      • event_day: Directly copied
1. model.amplitude.amplitude__daily_performance
  • Input Column: 5. model.amplitude.int_amplitude__date_spine[event_day]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the agg_event_data CTE
    • Aggregation The column is grouped by in the agg_event_data CTE
    • Output Columns:
      • event_day: Directly mapped to the output column
5. model.amplitude.int_amplitude__date_spine
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_day]
    • Integration Used to join with the spine CTE to ensure each event_type has a record for every day since their first day
    • Featurization Used to create the event_day column in the output
    • Output Columns:
      • event_day: Transformed from the spine.date_day and used as the output column
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_type 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_type 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_type 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 5. model.amplitude.int_amplitude__date_spine 5. model.amplitude.int_amplitude__date_spine event_type 2. model.amplitude.amplitude__event_enhanced:f0->5. model.amplitude.int_amplitude__date_spine:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance event_type 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 5. model.amplitude.int_amplitude__date_spine:f0->1. model.amplitude.amplitude__daily_performance:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • event_type: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_type]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with event_type table
    • Output Columns:
      • event_type: Directly copied
1. model.amplitude.amplitude__daily_performance
  • Input Column: 5. model.amplitude.int_amplitude__date_spine[event_type]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the agg_event_data CTE
    • Aggregation The column is grouped by in the agg_event_data CTE
    • Output Columns:
      • event_type: Directly mapped to the output column
5. model.amplitude.int_amplitude__date_spine
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_type]
    • Direct The event_type is directly selected from the event_data CTE
    • Integration Used to join with the spine CTE to create a record for each event type on every day
    • Output Columns:
      • event_type: Directly mapped to the output column
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_type_id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_type_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_type_id 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_type_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • event_type_id: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_type_id]
    • Integration Used to join with event_type table
    • Output Columns:
      • event_type_id: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp group_properties 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event group_properties 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[group_properties]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • group_properties: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp groups 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event group_types 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced group_types 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[groups]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is renamed to group_types
    • Output Columns:
      • group_types: Directly copied and renamed
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[group_types]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • group_types: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp idfa 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event idfa 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[idfa]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • idfa: Directly copied after casting
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp _insert_id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event _insert_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:header 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:header
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[_insert_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • _insert_id: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[_insert_id]
    • Deduplication Used in the deduplication logic to determine which records to keep
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[_insert_id]
    • Deduplication Used as a criterion for deduplicating events
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp ip_address 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event ip_address 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced ip_address 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[ip_address]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ip_address: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[ip_address]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ip_address: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp is_attribution_event 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event is_attribution_event 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[is_attribution_event]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as BOOLEAN
    • Output Columns:
      • is_attribution_event: Directly copied after casting
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp language 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event language 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced language 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[language]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • language: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[language]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • language: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp library 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event library 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[library]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • library: Directly copied after casting
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp location_lat 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event location_lat 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced location_lat 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[location_lat]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • location_lat: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[location_lat]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • location_lat: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp location_lng 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event location_lng 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced location_lng 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[location_lng]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • location_lng: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[location_lng]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • location_lng: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp os_name 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event os_name 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced os_name 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[os_name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • os_name: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[os_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • os_name: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp os_version 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event os_version 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced os_version 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[os_version]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • os_version: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[os_version]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • os_version: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp paying 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event is_paying 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[paying]
    • Direct The column is directly copied
    • Cleaning The column is cast as BOOLEAN
    • Output Columns:
      • is_paying: Directly copied after casting and renamed
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp platform 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event platform 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced platform 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[platform]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • platform: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[platform]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • platform: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp processed_time 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event processed_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[processed_time]
    • Direct The column is directly copied
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • processed_time: Directly copied after casting
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp project_name 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event project_name 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced project_name 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[project_name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • project_name: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[project_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • project_name: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp region 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event region 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced region 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[region]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • region: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[region]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • region: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp schema 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event schema 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced schema 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[schema]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • schema: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[schema]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • schema: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp server_received_time 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event server_received_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced server_received_time 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[server_received_time]
    • Direct The column is directly copied
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • server_received_time: Cast as TIMESTAMP and directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[server_received_time]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • server_received_time: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp server_upload_time 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event server_upload_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced server_upload_time 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[server_upload_time]
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • server_upload_time: Directly mapped after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[server_upload_time]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • server_upload_time: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp session_id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event session_id unique_session_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_event_number session_id unique_session_id 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions unique_session_id 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced total_sessions_per_user 2. model.amplitude.amplitude__event_enhanced:f2->4. model.amplitude.amplitude__user_enhanced:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_sessions 2. model.amplitude.amplitude__event_enhanced:f2->1. model.amplitude.amplitude__daily_performance:f0 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f2 3. model.amplitude.amplitude__sessions:f0->4. model.amplitude.amplitude__user_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[session_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Other Used in creating the unique_session_id
    • Output Columns:
      • session_id: Directly mapped
      • unique_session_id: Part of MD5 hash with user_id
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[unique_session_id]
    • Integration used as the key to join session_data with event_data
    • Direct directly copied to the output
    • Output Columns:
      • unique_session_id: directly copied
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[session_id]
    • Integration Used to create the unique_session_id by concatenating with user_id
    • Output Columns:
      • unique_session_id: Concatenated with user_id to form unique_session_id
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_session_id]
    • Aggregation Used in COUNT(DISTINCT unique_session_id) to calculate number_sessions
    • Output Columns:
      • number_sessions: Aggregated to count distinct sessions
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_session_id]
    • Integration Used to join the event_enhanced and session_data tables
    • Aggregation Used to count distinct sessions per user
    • Output Columns:
      • total_sessions_per_user: Aggregated as COUNT(DISTINCT unique_session_id)
  • Input Column: 3. model.amplitude.amplitude__sessions[unique_session_id]
    • Integration Used as the key to join with event_enhanced table
    • Aggregation Used in COUNT(DISTINCT) to calculate total_sessions_per_user
    • Output Columns:
      • total_sessions_per_user: Counted distinctly to get the total number of sessions per user
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp start_version 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event start_version 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced start_version 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[start_version]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • start_version: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[start_version]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • start_version: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp user_creation_time 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event user_creation_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced user_creation_time 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced user_created_at 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_new_users 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_creation_time]
    • Direct The column is directly copied
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • user_creation_time: Cast as TIMESTAMP and directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_creation_time]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • user_creation_time: Directly copied
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[user_creation_time]
    • Featurization Used to determine if a user is new on a given day
    • Output Columns:
      • number_new_users: Contributes to the count of new users
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[user_creation_time]
    • Aggregation This column is used in the MIN function to determine the earliest user creation time.
    • Output Columns:
      • user_created_at: The MIN of this column is mapped to user_created_at in the output.
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp user_id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event amplitude_user_id unique_session_id user_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced unique_session_id user_id 6. model.amplitude_source.stg_amplitude__event:f2->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event:f2->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions unique_session_id user_id 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f1 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced amplitude_user_id total_sessions_per_user 2. model.amplitude.amplitude__event_enhanced:f1->4. model.amplitude.amplitude__user_enhanced:f0 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f1 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_new_users number_sessions number_users 2. model.amplitude.amplitude__event_enhanced:f1->1. model.amplitude.amplitude__daily_performance:f2 2. model.amplitude.amplitude__event_enhanced:f1->1. model.amplitude.amplitude__daily_performance:f0 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f1 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions:f0->4. model.amplitude.amplitude__user_enhanced:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[unique_session_id]
    • Integration used as the key to join session_data with event_data
    • Direct directly copied to the output
    • Output Columns:
      • unique_session_id: directly copied
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_id]
    • Direct Copied without transformation
    • Integration Used to create the unique_session_id by concatenating with session_id
    • Aggregation Used in GROUP BY clause for session aggregation
    • Deduplication Used in window functions for session ranking and lag calculations
    • Output Columns:
      • user_id: Directly copied
      • unique_session_id: Concatenated with session_id to form unique_session_id
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[user_id]
    • Aggregation Used as part of COUNT(DISTINCT amplitude_user_id) to calculate number_users
    • Featurization Used to determine new users based on user_creation_time
    • Output Columns:
      • number_users: Aggregated to count distinct users
      • number_new_users: Used to identify new users
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_session_id]
    • Aggregation Used in COUNT(DISTINCT unique_session_id) to calculate number_sessions
    • Output Columns:
      • number_sessions: Aggregated to count distinct sessions
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[user_id]
    • Direct Used directly as amplitude_user_id
    • Integration Used to join with session_data table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • amplitude_user_id: Directly mapped
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_session_id]
    • Integration Used to join the event_enhanced and session_data tables
    • Aggregation Used to count distinct sessions per user
    • Output Columns:
      • total_sessions_per_user: Aggregated as COUNT(DISTINCT unique_session_id)
  • Input Column: 3. model.amplitude.amplitude__sessions[unique_session_id]
    • Integration Used as the key to join with event_enhanced table
    • Aggregation Used in COUNT(DISTINCT) to calculate total_sessions_per_user
    • Output Columns:
      • total_sessions_per_user: Counted distinctly to get the total number of sessions per user
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp user_properties 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event user_properties 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_properties]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • user_properties: Directly mapped
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp uuid 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event uuid 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:header 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:header
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[uuid]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • uuid: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[uuid]
    • Deduplication Used in the deduplication process as part of the ROW_NUMBER() function
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[uuid]
    • Deduplication The column is used as part of the deduplication process in the event_data CTE, where it's referred to as '_insert_id'.
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp version_name 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event version_name 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced version_name 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[version_name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • version_name: It is directly mapped to the output column 'version_name'
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[version_name]
    • Direct Directly copied without any transformation
    • Output Columns:
      • version_name: Directly copied to the output column
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp _fivetran_synced 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event _fivetran_synced 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[_fivetran_synced]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • _fivetran_synced: Directly mapped
7. model.amplitude_source.stg_amplitude__event_tmp

This SQL query selects all columns and rows from the 'event' table in the 'amplitude' schema of the 'TEST' database. It's a simple SELECT * statement without any filtering, transformation, or aggregation.

Other
SQL Query
SELECT
  *
FROM TEST.amplitude.event
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_id id server_upload_time _fivetran_synced _insert_id ad_id amplitude_event_type amplitude_id app city client_event_time client_upload_time country data device_brand device_carrier device_family device_manufacturer device_model device_type dma event_properties event_time event_type event_type_id group_properties groups idfa ip_address is_attribution_event language library location_lat location_lng os_name os_version paying platform processed_time project_name region sample_rate schema server_received_time session_id start_version user_creation_time user_id user_properties uuid version_name 10. source.amplitude_source.amplitude.event 10. source.amplitude_source.amplitude.event
Name Type Comment
device_id text None
id bigint None
server_upload_time timestamp without time zone None
_fivetran_synced timestamp without time zone None
_insert_id integer None
ad_id integer None
amplitude_event_type integer None
amplitude_id bigint None
app bigint None
city integer None
client_event_time timestamp without time zone None
client_upload_time timestamp without time zone None
country text None
data text None
device_brand integer None
device_carrier integer None
device_family integer None
device_manufacturer integer None
device_model integer None
device_type integer None
dma integer None
event_properties text None
event_time timestamp without time zone None
event_type text None
event_type_id bigint None
group_properties text None
groups text None
idfa integer None
ip_address text None
is_attribution_event boolean None
language integer None
library text None
location_lat integer None
location_lng integer None
os_name integer None
os_version integer None
paying integer None
platform integer None
processed_time timestamp without time zone None
project_name bigint None
region integer None
sample_rate integer None
schema bigint None
server_received_time timestamp without time zone None
session_id bigint None
start_version integer None
user_creation_time timestamp without time zone None
user_id character varying(100) None
user_properties text None
uuid text None
version_name integer None
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_id unique_event_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_id unique_event_id 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f1 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:header 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:header 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced total_events_per_user 2. model.amplitude.amplitude__event_enhanced:f1->4. model.amplitude.amplitude__user_enhanced:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_events 2. model.amplitude.amplitude__event_enhanced:f1->1. model.amplitude.amplitude__daily_performance:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Other Used in the MD5 hash to create unique_event_id
    • Output Columns:
      • device_id: Directly mapped
      • unique_event_id: Part of the MD5 hash
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the PARTITION BY clause for deduplication when _insert_id is NULL
    • Output Columns:
      • device_id: Directly copied
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_event_id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Output Columns:
      • unique_event_id: Directly copied
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_id]
    • Deduplication Used in the deduplication process when _insert_id is null
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_event_id]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_event_id]
    • Aggregation Used in COUNT(DISTINCT unique_event_id) to calculate number_events
    • Output Columns:
      • number_events: Aggregated to count distinct events
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_event_id]
    • Aggregation Used to count distinct events per user
    • Output Columns:
      • total_events_per_user: Aggregated as COUNT(DISTINCT unique_event_id)
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_id events_per_session 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions events_per_session 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f0 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[id]
    • Cleaning The column is cast as INT
    • Output Columns:
      • event_id: Directly mapped after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[events_per_session]
    • Direct directly copied to the output
    • Output Columns:
      • events_per_session: directly copied
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_id]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Aggregation Counted to calculate events_per_session
    • Output Columns:
      • events_per_session: Aggregated count of event_id
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp server_upload_time 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event server_upload_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced server_upload_time 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[server_upload_time]
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • server_upload_time: Directly mapped after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[server_upload_time]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • server_upload_time: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp _fivetran_synced 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event _fivetran_synced 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[_fivetran_synced]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • _fivetran_synced: Directly mapped
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp _insert_id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event _insert_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:header 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:header
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[_insert_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • _insert_id: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[_insert_id]
    • Deduplication Used in the deduplication logic to determine which records to keep
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[_insert_id]
    • Deduplication Used as a criterion for deduplicating events
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp ad_id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event ad_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[ad_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_id: Directly mapped
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp amplitude_id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event amplitude_id amplitude_user_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced amplitude_id amplitude_user_id 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f1 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:header 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced amplitude_user_id 2. model.amplitude.amplitude__event_enhanced:f1->4. model.amplitude.amplitude__user_enhanced:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_new_users number_users 2. model.amplitude.amplitude__event_enhanced:f1->1. model.amplitude.amplitude__daily_performance:f1 2. model.amplitude.amplitude__event_enhanced:f1->1. model.amplitude.amplitude__daily_performance:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[amplitude_id]
    • Cleaning The column is cast as TEXT
    • Other Used as a fallback for amplitude_user_id when user_id is null
    • Output Columns:
      • amplitude_id: Directly mapped after casting
      • amplitude_user_id: Used as fallback when user_id is null
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[amplitude_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • amplitude_id: Directly copied
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[amplitude_user_id]
    • Direct The column is directly copied without any transformation
    • Cleaning Cast as TEXT
    • Featurization Used to generate user_event_number
    • Output Columns:
      • amplitude_user_id: Directly copied after casting to TEXT
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[amplitude_user_id]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[amplitude_user_id]
    • Aggregation Used in COUNT(DISTINCT amplitude_user_id) to calculate number_users and number_new_users
    • Output Columns:
      • number_users: Aggregated to count distinct users
      • number_new_users: Aggregated to count distinct new users
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[amplitude_user_id]
    • Integration Used as the key to join the event_enhanced and session_data tables
    • Aggregation Used as the grouping key for all aggregations
    • Output Columns:
      • amplitude_user_id: Directly copied to the output
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp app 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event app 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced app 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[app]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • app: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[app]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • app: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp city 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event city 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced city 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[city]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • city: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[city]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • city: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_event_time 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_event_time unique_event_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced client_event_time session_ended_at session_length_in_minutes session_started_at unique_event_id 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f4 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_ended_at session_length_in_minutes session_started_at 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f2 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f1 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:header 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance event_day number_events 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 2. model.amplitude.amplitude__event_enhanced:f4->1. model.amplitude.amplitude__daily_performance:f1 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced average_session_length_in_minutes first_session_at last_session_at total_events_per_user 2. model.amplitude.amplitude__event_enhanced:f4->4. model.amplitude.amplitude__user_enhanced:f3 2. model.amplitude.amplitude__event_enhanced:f3->4. model.amplitude.amplitude__user_enhanced:f1 2. model.amplitude.amplitude__event_enhanced:f1->4. model.amplitude.amplitude__user_enhanced:f2 2. model.amplitude.amplitude__event_enhanced:f2->4. model.amplitude.amplitude__user_enhanced:f0 3. model.amplitude.amplitude__sessions:f2->2. model.amplitude.amplitude__event_enhanced:f3 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f1 3. model.amplitude.amplitude__sessions:f1->2. model.amplitude.amplitude__event_enhanced:f2 3. model.amplitude.amplitude__sessions:f1->4. model.amplitude.amplitude__user_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create unique_event_id
    • Output Columns:
      • client_event_time: Directly copied after casting to TIMESTAMP
      • unique_event_id: Part of the MD5 hash to create this column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_started_at]
    • Direct directly copied to the output
    • Output Columns:
      • session_started_at: directly copied
  • Input Column: 3. model.amplitude.amplitude__sessions[session_ended_at]
    • Direct directly copied to the output
    • Output Columns:
      • session_ended_at: directly copied
  • Input Column: 3. model.amplitude.amplitude__sessions[session_length_in_minutes]
    • Direct This column is directly copied from the input to the output without any transformation.
    • Output Columns:
      • session_length_in_minutes: Directly copied to the output column with the same name.
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_event_time]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
    • Aggregation Used to determine session start and end times
    • Output Columns:
      • session_started_at: Minimum client_event_time for a session
      • session_ended_at: Maximum client_event_time for a session
      • session_length_in_minutes: Calculated from the difference between max and min client_event_time
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_event_id]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[client_event_time]
    • Aggregation Used to determine the event day for grouping
    • Output Columns:
      • event_day: Derived from DATE_TRUNC('DAY', client_event_time)
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_event_id]
    • Aggregation Used in COUNT(DISTINCT unique_event_id) to calculate number_events
    • Output Columns:
      • number_events: Aggregated to count distinct events
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_started_at]
    • Aggregation Used in MIN function to find first session
    • Output Columns:
      • first_session_at: Aggregated to find the earliest session start
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_ended_at]
    • Aggregation Used in MAX function to find last session
    • Output Columns:
      • last_session_at: Aggregated to find the latest session end
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_length_in_minutes]
    • Aggregation This column is used in the AVG() function to calculate the average session length for each user.
    • Output Columns:
      • average_session_length_in_minutes: The average value of this column is calculated for each user.
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp client_upload_time 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event client_upload_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced client_upload_time 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:header
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[client_upload_time]
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • client_upload_time: Directly copied after casting to TIMESTAMP
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_upload_time]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ORDER BY clause of the ROW_NUMBER() function for deduplication
    • Output Columns:
      • client_upload_time: Directly copied
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[client_upload_time]
    • Deduplication Used in the ORDER BY clause of ROW_NUMBER() function for deduplication
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp country 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event country 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced country 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[country]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • country: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[country]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • country: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp data 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event data 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced data 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[data]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • data: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[data]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • data: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_brand 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_brand 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_brand 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_brand]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_brand: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_brand]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_brand: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_carrier 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_carrier 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_carrier 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_carrier]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_carrier: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_carrier]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_carrier: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_family 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_family 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_family 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_family]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_family: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_family]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_family: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_manufacturer 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_manufacturer 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_manufacturer 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_manufacturer]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_manufacturer: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_manufacturer]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_manufacturer: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_model 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_model 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_model 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_model]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_model: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_model]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_model: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp device_type 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event device_type 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced device_type 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[device_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device_type: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[device_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • device_type: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp dma 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event dma 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced dma 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[dma]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • dma: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[dma]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • dma: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_properties 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_properties 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_properties]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • event_properties: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_time 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_day event_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_day event_time session_ended_at session_ended_at_day session_started_at session_started_at_day 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions session_ended_at session_ended_at_day session_started_at session_started_at_day 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f2 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f3 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f1 5. model.amplitude.int_amplitude__date_spine 5. model.amplitude.int_amplitude__date_spine event_day 2. model.amplitude.amplitude__event_enhanced:f0->5. model.amplitude.int_amplitude__date_spine:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance event_day 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced first_session_at last_session_at 2. model.amplitude.amplitude__event_enhanced:f4->4. model.amplitude.amplitude__user_enhanced:f0 2. model.amplitude.amplitude__event_enhanced:f2->4. model.amplitude.amplitude__user_enhanced:f1 2. model.amplitude.amplitude__event_enhanced:f5->4. model.amplitude.amplitude__user_enhanced:f0 2. model.amplitude.amplitude__event_enhanced:f3->4. model.amplitude.amplitude__user_enhanced:f1 3. model.amplitude.amplitude__sessions:f2->2. model.amplitude.amplitude__event_enhanced:f4 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f2 3. model.amplitude.amplitude__sessions:f3->2. model.amplitude.amplitude__event_enhanced:f5 3. model.amplitude.amplitude__sessions:f1->2. model.amplitude.amplitude__event_enhanced:f3 5. model.amplitude.int_amplitude__date_spine:f0->1. model.amplitude.amplitude__daily_performance:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_time]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create event_day
    • Filtering Used to filter records based on date range
    • Output Columns:
      • event_time: Directly copied after casting
      • event_day: Derived from event_time
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[session_started_at]
    • Direct directly copied to the output
    • Output Columns:
      • session_started_at: directly copied
  • Input Column: 3. model.amplitude.amplitude__sessions[session_ended_at]
    • Direct directly copied to the output
    • Output Columns:
      • session_ended_at: directly copied
  • Input Column: 3. model.amplitude.amplitude__sessions[session_started_at_day]
    • Direct directly copied to the output
    • Output Columns:
      • session_started_at_day: directly copied
  • Input Column: 3. model.amplitude.amplitude__sessions[session_ended_at_day]
    • Direct directly copied to the output
    • Output Columns:
      • session_ended_at_day: directly copied
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_time]
    • Aggregation Used to determine session start and end times
    • Cleaning Truncated to day for session_started_at_day and session_ended_at_day
    • Output Columns:
      • session_started_at: Minimum event_time for a session
      • session_ended_at: Maximum event_time for a session
      • session_started_at_day: Truncated event_time to day for session start
      • session_ended_at_day: Truncated event_time to day for session end
1. model.amplitude.amplitude__daily_performance
  • Input Column: 5. model.amplitude.int_amplitude__date_spine[event_day]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the agg_event_data CTE
    • Aggregation The column is grouped by in the agg_event_data CTE
    • Output Columns:
      • event_day: Directly mapped to the output column
5. model.amplitude.int_amplitude__date_spine
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_day]
    • Integration Used to join with the spine CTE to ensure each event_type has a record for every day since their first day
    • Featurization Used to create the event_day column in the output
    • Output Columns:
      • event_day: Transformed from the spine.date_day and used as the output column
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_started_at]
    • Aggregation Used in MIN function to find first session
    • Output Columns:
      • first_session_at: Aggregated to find the earliest session start
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_ended_at]
    • Aggregation Used in MAX function to find last session
    • Output Columns:
      • last_session_at: Aggregated to find the latest session end
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_started_at_day]
    • Aggregation This column is used in the MIN() function to determine the first session date for each user.
    • Output Columns:
      • first_session_at: The minimum value of this column is used to determine the first session timestamp for each user.
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[session_ended_at_day]
    • Aggregation This column is used in the MAX() function to determine the last session date for each user.
    • Output Columns:
      • last_session_at: The maximum value of this column is used to determine the last session timestamp for each user.
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_type 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_type 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_type 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 5. model.amplitude.int_amplitude__date_spine 5. model.amplitude.int_amplitude__date_spine event_type 2. model.amplitude.amplitude__event_enhanced:f0->5. model.amplitude.int_amplitude__date_spine:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance event_type 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 5. model.amplitude.int_amplitude__date_spine:f0->1. model.amplitude.amplitude__daily_performance:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • event_type: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_type]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with event_type table
    • Output Columns:
      • event_type: Directly copied
1. model.amplitude.amplitude__daily_performance
  • Input Column: 5. model.amplitude.int_amplitude__date_spine[event_type]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the agg_event_data CTE
    • Aggregation The column is grouped by in the agg_event_data CTE
    • Output Columns:
      • event_type: Directly mapped to the output column
5. model.amplitude.int_amplitude__date_spine
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_type]
    • Direct The event_type is directly selected from the event_data CTE
    • Integration Used to join with the spine CTE to create a record for each event type on every day
    • Output Columns:
      • event_type: Directly mapped to the output column
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp event_type_id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event event_type_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_type_id 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[event_type_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • event_type_id: Directly copied
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[event_type_id]
    • Integration Used to join with event_type table
    • Output Columns:
      • event_type_id: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp group_properties 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event group_properties 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[group_properties]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • group_properties: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp groups 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event group_types 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced group_types 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[groups]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is renamed to group_types
    • Output Columns:
      • group_types: Directly copied and renamed
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[group_types]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • group_types: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp idfa 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event idfa 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[idfa]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • idfa: Directly copied after casting
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp ip_address 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event ip_address 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced ip_address 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[ip_address]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ip_address: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[ip_address]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ip_address: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp is_attribution_event 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event is_attribution_event 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[is_attribution_event]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as BOOLEAN
    • Output Columns:
      • is_attribution_event: Directly copied after casting
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp language 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event language 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced language 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[language]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • language: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[language]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • language: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp library 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event library 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[library]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • library: Directly copied after casting
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp location_lat 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event location_lat 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced location_lat 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[location_lat]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • location_lat: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[location_lat]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • location_lat: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp location_lng 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event location_lng 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced location_lng 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[location_lng]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • location_lng: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[location_lng]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • location_lng: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp os_name 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event os_name 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced os_name 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[os_name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • os_name: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[os_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • os_name: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp os_version 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event os_version 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced os_version 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[os_version]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • os_version: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[os_version]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • os_version: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp paying 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event is_paying 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[paying]
    • Direct The column is directly copied
    • Cleaning The column is cast as BOOLEAN
    • Output Columns:
      • is_paying: Directly copied after casting and renamed
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp platform 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event platform 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced platform 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[platform]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • platform: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[platform]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • platform: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp processed_time 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event processed_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[processed_time]
    • Direct The column is directly copied
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • processed_time: Directly copied after casting
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp project_name 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event project_name 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced project_name 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[project_name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • project_name: Directly copied after casting
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[project_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • project_name: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp region 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event region 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced region 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[region]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • region: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[region]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • region: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp schema 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event schema 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced schema 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[schema]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • schema: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[schema]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • schema: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp server_received_time 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event server_received_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced server_received_time 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[server_received_time]
    • Direct The column is directly copied
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • server_received_time: Cast as TIMESTAMP and directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[server_received_time]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • server_received_time: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp session_id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event session_id unique_session_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced session_event_number session_id unique_session_id 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f2 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions unique_session_id 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced total_sessions_per_user 2. model.amplitude.amplitude__event_enhanced:f2->4. model.amplitude.amplitude__user_enhanced:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_sessions 2. model.amplitude.amplitude__event_enhanced:f2->1. model.amplitude.amplitude__daily_performance:f0 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f2 3. model.amplitude.amplitude__sessions:f0->4. model.amplitude.amplitude__user_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[session_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Other Used in creating the unique_session_id
    • Output Columns:
      • session_id: Directly mapped
      • unique_session_id: Part of MD5 hash with user_id
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[unique_session_id]
    • Integration used as the key to join session_data with event_data
    • Direct directly copied to the output
    • Output Columns:
      • unique_session_id: directly copied
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[session_id]
    • Integration Used to create the unique_session_id by concatenating with user_id
    • Output Columns:
      • unique_session_id: Concatenated with user_id to form unique_session_id
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_session_id]
    • Direct Directly used in the output
    • Aggregation Used as a grouping key
    • Output Columns:
      • unique_session_id: Directly copied
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_session_id]
    • Aggregation Used in COUNT(DISTINCT unique_session_id) to calculate number_sessions
    • Output Columns:
      • number_sessions: Aggregated to count distinct sessions
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_session_id]
    • Integration Used to join the event_enhanced and session_data tables
    • Aggregation Used to count distinct sessions per user
    • Output Columns:
      • total_sessions_per_user: Aggregated as COUNT(DISTINCT unique_session_id)
  • Input Column: 3. model.amplitude.amplitude__sessions[unique_session_id]
    • Integration Used as the key to join with event_enhanced table
    • Aggregation Used in COUNT(DISTINCT) to calculate total_sessions_per_user
    • Output Columns:
      • total_sessions_per_user: Counted distinctly to get the total number of sessions per user
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp start_version 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event start_version 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced start_version 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[start_version]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • start_version: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[start_version]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • start_version: Directly copied
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp user_creation_time 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event user_creation_time 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced user_creation_time 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced user_created_at 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_new_users 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_creation_time]
    • Direct The column is directly copied
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • user_creation_time: Cast as TIMESTAMP and directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_creation_time]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • user_creation_time: Directly copied
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[user_creation_time]
    • Featurization Used to determine if a user is new on a given day
    • Output Columns:
      • number_new_users: Contributes to the count of new users
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[user_creation_time]
    • Aggregation This column is used in the MIN function to determine the earliest user creation time.
    • Output Columns:
      • user_created_at: The MIN of this column is mapped to user_created_at in the output.
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp user_id 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event amplitude_user_id unique_session_id user_id 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f2 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f1 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced amplitude_user_id unique_session_id user_id 6. model.amplitude_source.stg_amplitude__event:f2->2. model.amplitude.amplitude__event_enhanced:f2 6. model.amplitude_source.stg_amplitude__event:f2->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event:f1->2. model.amplitude.amplitude__event_enhanced:f1 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions unique_session_id user_id 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f1 6. model.amplitude_source.stg_amplitude__event:f2->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f1->3. model.amplitude.amplitude__sessions:f0 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:header 4. model.amplitude.amplitude__user_enhanced 4. model.amplitude.amplitude__user_enhanced amplitude_user_id total_sessions_per_user 2. model.amplitude.amplitude__event_enhanced:f2->4. model.amplitude.amplitude__user_enhanced:f0 2. model.amplitude.amplitude__event_enhanced:f1->4. model.amplitude.amplitude__user_enhanced:f1 2. model.amplitude.amplitude__event_enhanced:f0->4. model.amplitude.amplitude__user_enhanced:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance number_new_users number_sessions number_users 2. model.amplitude.amplitude__event_enhanced:f2->1. model.amplitude.amplitude__daily_performance:f2 2. model.amplitude.amplitude__event_enhanced:f2->1. model.amplitude.amplitude__daily_performance:f0 2. model.amplitude.amplitude__event_enhanced:f1->1. model.amplitude.amplitude__daily_performance:f1 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f2 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 3. model.amplitude.amplitude__sessions:f0->2. model.amplitude.amplitude__event_enhanced:f1 3. model.amplitude.amplitude__sessions:f0->4. model.amplitude.amplitude__user_enhanced:f1
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_id]
    • Direct The column is directly copied
    • Cleaning The column is cast as TEXT
    • Other Used in creating the unique_session_id and amplitude_user_id
    • Output Columns:
      • user_id: Cast as TEXT and directly mapped
      • unique_session_id: Part of MD5 hash with session_id
      • amplitude_user_id: Used as primary value, with amplitude_id as fallback
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 3. model.amplitude.amplitude__sessions[unique_session_id]
    • Integration used as the key to join session_data with event_data
    • Direct directly copied to the output
    • Output Columns:
      • unique_session_id: directly copied
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[user_id]
    • Direct Copied without transformation
    • Integration Used to create the unique_session_id by concatenating with session_id
    • Aggregation Used in GROUP BY clause for session aggregation
    • Deduplication Used in window functions for session ranking and lag calculations
    • Output Columns:
      • user_id: Directly copied
      • unique_session_id: Concatenated with session_id to form unique_session_id
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[unique_session_id]
    • Direct Directly used in the output
    • Aggregation Used as a grouping key
    • Output Columns:
      • unique_session_id: Directly copied
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[amplitude_user_id]
    • Deduplication Used in the ROW_NUMBER() function for deduplication
1. model.amplitude.amplitude__daily_performance
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[user_id]
    • Aggregation Used as part of COUNT(DISTINCT amplitude_user_id) to calculate number_users
    • Featurization Used to determine new users based on user_creation_time
    • Output Columns:
      • number_users: Aggregated to count distinct users
      • number_new_users: Used to identify new users
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_session_id]
    • Aggregation Used in COUNT(DISTINCT unique_session_id) to calculate number_sessions
    • Output Columns:
      • number_sessions: Aggregated to count distinct sessions
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[amplitude_user_id]
    • Aggregation Used in COUNT(DISTINCT amplitude_user_id) to calculate number_users and number_new_users
    • Output Columns:
      • number_users: Aggregated to count distinct users
      • number_new_users: Aggregated to count distinct new users
4. model.amplitude.amplitude__user_enhanced
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[user_id]
    • Direct Used directly as amplitude_user_id
    • Integration Used to join with session_data table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • amplitude_user_id: Directly mapped
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[unique_session_id]
    • Integration Used to join the event_enhanced and session_data tables
    • Aggregation Used to count distinct sessions per user
    • Output Columns:
      • total_sessions_per_user: Aggregated as COUNT(DISTINCT unique_session_id)
  • Input Column: 3. model.amplitude.amplitude__sessions[unique_session_id]
    • Integration Used as the key to join with event_enhanced table
    • Aggregation Used in COUNT(DISTINCT) to calculate total_sessions_per_user
    • Output Columns:
      • total_sessions_per_user: Counted distinctly to get the total number of sessions per user
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[amplitude_user_id]
    • Integration Used as the key to join the event_enhanced and session_data tables
    • Aggregation Used as the grouping key for all aggregations
    • Output Columns:
      • amplitude_user_id: Directly copied to the output
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp user_properties 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event user_properties 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[user_properties]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • user_properties: Directly mapped
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp uuid 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event uuid 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:header 3. model.amplitude.amplitude__sessions 3. model.amplitude.amplitude__sessions 6. model.amplitude_source.stg_amplitude__event:f0->3. model.amplitude.amplitude__sessions:header
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[uuid]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • uuid: Directly mapped
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[uuid]
    • Deduplication Used in the deduplication process as part of the ROW_NUMBER() function
3. model.amplitude.amplitude__sessions
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[uuid]
    • Deduplication The column is used as part of the deduplication process in the event_data CTE, where it's referred to as '_insert_id'.
Column Lineage
%3 7. model.amplitude_source.stg_amplitude__event_tmp 7. model.amplitude_source.stg_amplitude__event_tmp version_name 6. model.amplitude_source.stg_amplitude__event 6. model.amplitude_source.stg_amplitude__event version_name 7. model.amplitude_source.stg_amplitude__event_tmp:f0->6. model.amplitude_source.stg_amplitude__event:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced version_name 6. model.amplitude_source.stg_amplitude__event:f0->2. model.amplitude.amplitude__event_enhanced:f0
6. model.amplitude_source.stg_amplitude__event
  • Input Column: 7. model.amplitude_source.stg_amplitude__event_tmp[version_name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • version_name: It is directly mapped to the output column 'version_name'
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 6. model.amplitude_source.stg_amplitude__event[version_name]
    • Direct Directly copied without any transformation
    • Output Columns:
      • version_name: Directly copied to the output column
8. model.amplitude_source.stg_amplitude__event_type

This SQL query performs a series of transformations on data from a staging table for Amplitude event types. It casts columns to specific data types, renames and reorganizes fields, and creates a unique identifier for each event type using a hash function. The query doesn't filter or aggregate data, but rather focuses on restructuring and cleaning the existing information.

CleaningFeaturizationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC__source_amplitude.stg_amplitude__event_type_tmp
), fields AS (
  SELECT
    CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS BOOLEAN) AS autohidden,
    CAST(NULL AS BOOLEAN) AS deleted,
    CAST(NULL AS TEXT) AS display,
    CAST(NULL AS BOOLEAN) AS flow_hidden,
    CAST(NULL AS BOOLEAN) AS hidden,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS BOOLEAN) AS in_waitroom,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS BOOLEAN) AS non_active,
    CAST(NULL AS TEXT) AS project_name,
    CAST(NULL AS BOOLEAN) AS timeline_hidden,
    CAST(NULL AS INT) AS totals,
    CAST(NULL AS INT) AS totals_delta,
    CAST(NULL AS TEXT) AS value,
    CAST(NULL AS TEXT) AS waitroom_approved
  FROM base
), final AS (
  SELECT
    id AS event_type_id,
    name AS event_type_name,
    project_name,
    display,
    totals,
    totals_delta,
    value,
    flow_hidden AS is_flow_hidden,
    hidden AS is_hidden,
    in_waitroom AS is_in_waitroom,
    non_active AS is_non_active,
    autohidden AS is_autohidden,
    deleted AS is_deleted,
    timeline_hidden AS is_timeline_hidden,
    waitroom_approved AS is_waitroom_approved,
    _fivetran_deleted,
    _fivetran_synced
  FROM fields
), surrogate AS (
  SELECT
    *,
    MD5(
      CAST(COALESCE(CAST(event_type_id AS TEXT), '_dbt_utils_surrogate_key_null_') || '-' || COALESCE(CAST(project_name AS TEXT), '_dbt_utils_surrogate_key_null_') AS TEXT)
    ) AS unique_event_type_id
  FROM final
)
SELECT
  *
FROM surrogate
%3 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type unique_event_type_id event_type_id _fivetran_deleted _fivetran_synced is_autohidden is_deleted display is_flow_hidden is_hidden is_in_waitroom event_type_name is_non_active project_name is_timeline_hidden totals totals_delta value is_waitroom_approved 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp id project_name _fivetran_deleted _fivetran_synced autohidden deleted display flow_hidden hidden in_waitroom name non_active timeline_hidden totals totals_delta value waitroom_approved 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f1 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0 9. model.amplitude_source.stg_amplitude__event_type_tmp:f1->8. model.amplitude_source.stg_amplitude__event_type:f12 9. model.amplitude_source.stg_amplitude__event_type_tmp:f1->8. model.amplitude_source.stg_amplitude__event_type:f0 9. model.amplitude_source.stg_amplitude__event_type_tmp:f2->8. model.amplitude_source.stg_amplitude__event_type:f2 9. model.amplitude_source.stg_amplitude__event_type_tmp:f3->8. model.amplitude_source.stg_amplitude__event_type:f3 9. model.amplitude_source.stg_amplitude__event_type_tmp:f4->8. model.amplitude_source.stg_amplitude__event_type:f4 9. model.amplitude_source.stg_amplitude__event_type_tmp:f5->8. model.amplitude_source.stg_amplitude__event_type:f5 9. model.amplitude_source.stg_amplitude__event_type_tmp:f6->8. model.amplitude_source.stg_amplitude__event_type:f6 9. model.amplitude_source.stg_amplitude__event_type_tmp:f7->8. model.amplitude_source.stg_amplitude__event_type:f7 9. model.amplitude_source.stg_amplitude__event_type_tmp:f8->8. model.amplitude_source.stg_amplitude__event_type:f8 9. model.amplitude_source.stg_amplitude__event_type_tmp:f9->8. model.amplitude_source.stg_amplitude__event_type:f9 9. model.amplitude_source.stg_amplitude__event_type_tmp:f10->8. model.amplitude_source.stg_amplitude__event_type:f10 9. model.amplitude_source.stg_amplitude__event_type_tmp:f11->8. model.amplitude_source.stg_amplitude__event_type:f11 9. model.amplitude_source.stg_amplitude__event_type_tmp:f12->8. model.amplitude_source.stg_amplitude__event_type:f13 9. model.amplitude_source.stg_amplitude__event_type_tmp:f13->8. model.amplitude_source.stg_amplitude__event_type:f14 9. model.amplitude_source.stg_amplitude__event_type_tmp:f14->8. model.amplitude_source.stg_amplitude__event_type:f15 9. model.amplitude_source.stg_amplitude__event_type_tmp:f15->8. model.amplitude_source.stg_amplitude__event_type:f16 9. model.amplitude_source.stg_amplitude__event_type_tmp:f16->8. model.amplitude_source.stg_amplitude__event_type:f17
Name Type Comment
unique_event_type_id text A unique key for each event, concatenating event_type_id and project_name.
event_type_id bigint Event type ID.
_fivetran_deleted boolean Timestamp of when Fivetran marked a record as deleted.
_fivetran_synced timestamp without time zone Timestamp of when Fivetran synced a record.
is_autohidden boolean Boolean of whether event type is hidden.
is_deleted boolean Boolean of whether event type is deleted.
display text The display name of the event.
is_flow_hidden boolean Boolean of whether the event is hidden from Pathfinder/Pathfinder Users or not.
is_hidden boolean Boolean of whether the event is hidden or not.
is_in_waitroom boolean Boolean of whether event type is in waitroom.
event_type_name text Event type name.
is_non_active boolean Boolean of whether the event is marked inactive or not.
project_name bigint Project name.
is_timeline_hidden boolean Boolean of whether the event is hidden or not.
totals integer The total number of times the event has happened this week.
totals_delta integer Represents the change in event volume from the previous week.
value text Name of the event in the raw data.
is_waitroom_approved integer Boolean of whether is waitroom approved.
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp id project_name 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type event_type_id project_name unique_event_type_id 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f2 9. model.amplitude_source.stg_amplitude__event_type_tmp:f1->8. model.amplitude_source.stg_amplitude__event_type:f1 9. model.amplitude_source.stg_amplitude__event_type_tmp:f1->8. model.amplitude_source.stg_amplitude__event_type:f2
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[id]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • event_type_id: Directly mapped after casting
      • unique_event_type_id: Used as part of the MD5 hash
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[project_name]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • project_name: Directly mapped after casting
      • unique_event_type_id: Used as part of the MD5 hash
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp id 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type event_type_id unique_event_type_id 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f1 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_type_id 8. model.amplitude_source.stg_amplitude__event_type:f0->2. model.amplitude.amplitude__event_enhanced:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[id]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • event_type_id: Directly mapped after casting
      • unique_event_type_id: Used as part of the MD5 hash
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 8. model.amplitude_source.stg_amplitude__event_type[event_type_id]
    • Integration Used as a key to join with event_data table
    • Direct Directly copied to the output
    • Output Columns:
      • event_type_id: Directly copied
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp _fivetran_deleted 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type _fivetran_deleted 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[_fivetran_deleted]
    • Cleaning The column is cast to BOOLEAN type
    • Direct The column is directly copied to the output
    • Output Columns:
      • _fivetran_deleted: Directly mapped after casting
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp _fivetran_synced 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type _fivetran_synced 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[_fivetran_synced]
    • Cleaning The column is cast to TIMESTAMP type
    • Direct The column is directly copied to the output
    • Output Columns:
      • _fivetran_synced: Directly mapped after casting
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp autohidden 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type is_autohidden 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[autohidden]
    • Cleaning The column is cast to BOOLEAN type
    • Direct The column is directly copied to the output
    • Output Columns:
      • is_autohidden: Directly mapped after casting and renaming
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp deleted 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type is_deleted 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[deleted]
    • Cleaning The column is cast to BOOLEAN type
    • Direct The column is directly copied to the output
    • Output Columns:
      • is_deleted: Directly mapped after casting and renaming
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp display 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type display 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[display]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • display: Directly mapped after casting
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp flow_hidden 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type is_flow_hidden 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[flow_hidden]
    • Cleaning The column is cast to BOOLEAN type
    • Direct The column is directly copied to the output
    • Output Columns:
      • is_flow_hidden: Directly mapped after casting and renaming
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp hidden 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type is_hidden 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[hidden]
    • Cleaning The column is cast to BOOLEAN type
    • Direct The column is directly copied to the output
    • Output Columns:
      • is_hidden: Directly mapped after casting and renaming
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp in_waitroom 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type is_in_waitroom 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[in_waitroom]
    • Cleaning The column is cast to BOOLEAN type
    • Direct The column is directly copied to the output
    • Output Columns:
      • is_in_waitroom: Directly mapped after casting and renaming
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp name 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type event_type_name 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_type_name 8. model.amplitude_source.stg_amplitude__event_type:f0->2. model.amplitude.amplitude__event_enhanced:f0 5. model.amplitude.int_amplitude__date_spine 5. model.amplitude.int_amplitude__date_spine event_type 2. model.amplitude.amplitude__event_enhanced:f0->5. model.amplitude.int_amplitude__date_spine:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance event_type 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 5. model.amplitude.int_amplitude__date_spine:f0->1. model.amplitude.amplitude__daily_performance:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • event_type_name: Directly mapped to this output column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 8. model.amplitude_source.stg_amplitude__event_type[event_type_name]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with event_data
    • Output Columns:
      • event_type_name: Directly mapped
1. model.amplitude.amplitude__daily_performance
  • Input Column: 5. model.amplitude.int_amplitude__date_spine[event_type]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the agg_event_data CTE
    • Aggregation The column is grouped by in the agg_event_data CTE
    • Output Columns:
      • event_type: Directly mapped to the output column
5. model.amplitude.int_amplitude__date_spine
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_type_name]
    • Integration Used to join with the spine table to create records for each event type
    • Output Columns:
      • event_type: Likely mapped directly to this output column
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp non_active 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type is_non_active 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[non_active]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as BOOLEAN type
    • Output Columns:
      • is_non_active: Directly mapped to this output column
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp project_name 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type project_name unique_event_type_id 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f1
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[project_name]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • project_name: Directly mapped after casting
      • unique_event_type_id: Used as part of the MD5 hash
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp timeline_hidden 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type is_timeline_hidden 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[timeline_hidden]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as BOOLEAN type
    • Output Columns:
      • is_timeline_hidden: Directly mapped to this output column
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp totals 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type totals 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced totals 8. model.amplitude_source.stg_amplitude__event_type:f0->2. model.amplitude.amplitude__event_enhanced:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[totals]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • totals: Directly mapped to this output column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 8. model.amplitude_source.stg_amplitude__event_type[totals]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • totals: Directly mapped
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp totals_delta 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type totals_delta 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[totals_delta]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • totals_delta: Directly mapped to this output column
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp value 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type value 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced value 8. model.amplitude_source.stg_amplitude__event_type:f0->2. model.amplitude.amplitude__event_enhanced:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[value]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • value: Directly mapped to this output column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 8. model.amplitude_source.stg_amplitude__event_type[value]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • value: Directly mapped
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp waitroom_approved 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type is_waitroom_approved 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[waitroom_approved]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • is_waitroom_approved: Directly mapped to this output column
9. model.amplitude_source.stg_amplitude__event_type_tmp

This SQL query selects all columns and rows from the 'event_type' table in the 'amplitude' schema of the 'TEST' database. It's a simple SELECT * statement without any filtering, transformation, or aggregation.

Other
SQL Query
SELECT
  *
FROM TEST.amplitude.event_type
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp id project_name _fivetran_deleted _fivetran_synced autohidden deleted display flow_hidden hidden in_waitroom name non_active timeline_hidden totals totals_delta value waitroom_approved 11. source.amplitude_source.amplitude.event_type 11. source.amplitude_source.amplitude.event_type
Name Type Comment
id bigint None
project_name bigint None
_fivetran_deleted boolean None
_fivetran_synced timestamp without time zone None
autohidden boolean None
deleted boolean None
display text None
flow_hidden boolean None
hidden boolean None
in_waitroom boolean None
name text None
non_active boolean None
timeline_hidden boolean None
totals integer None
totals_delta integer None
value text None
waitroom_approved integer None
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp id 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type event_type_id unique_event_type_id 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f1 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_type_id 8. model.amplitude_source.stg_amplitude__event_type:f0->2. model.amplitude.amplitude__event_enhanced:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[id]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • event_type_id: Directly mapped after casting
      • unique_event_type_id: Used as part of the MD5 hash
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 8. model.amplitude_source.stg_amplitude__event_type[event_type_id]
    • Integration Used as a key to join with event_data table
    • Direct Directly copied to the output
    • Output Columns:
      • event_type_id: Directly copied
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp project_name 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type project_name unique_event_type_id 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f1
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[project_name]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • project_name: Directly mapped after casting
      • unique_event_type_id: Used as part of the MD5 hash
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp _fivetran_deleted 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type _fivetran_deleted 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[_fivetran_deleted]
    • Cleaning The column is cast to BOOLEAN type
    • Direct The column is directly copied to the output
    • Output Columns:
      • _fivetran_deleted: Directly mapped after casting
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp _fivetran_synced 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type _fivetran_synced 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[_fivetran_synced]
    • Cleaning The column is cast to TIMESTAMP type
    • Direct The column is directly copied to the output
    • Output Columns:
      • _fivetran_synced: Directly mapped after casting
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp autohidden 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type is_autohidden 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[autohidden]
    • Cleaning The column is cast to BOOLEAN type
    • Direct The column is directly copied to the output
    • Output Columns:
      • is_autohidden: Directly mapped after casting and renaming
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp deleted 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type is_deleted 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[deleted]
    • Cleaning The column is cast to BOOLEAN type
    • Direct The column is directly copied to the output
    • Output Columns:
      • is_deleted: Directly mapped after casting and renaming
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp display 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type display 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[display]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • display: Directly mapped after casting
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp flow_hidden 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type is_flow_hidden 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[flow_hidden]
    • Cleaning The column is cast to BOOLEAN type
    • Direct The column is directly copied to the output
    • Output Columns:
      • is_flow_hidden: Directly mapped after casting and renaming
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp hidden 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type is_hidden 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[hidden]
    • Cleaning The column is cast to BOOLEAN type
    • Direct The column is directly copied to the output
    • Output Columns:
      • is_hidden: Directly mapped after casting and renaming
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp in_waitroom 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type is_in_waitroom 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[in_waitroom]
    • Cleaning The column is cast to BOOLEAN type
    • Direct The column is directly copied to the output
    • Output Columns:
      • is_in_waitroom: Directly mapped after casting and renaming
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp name 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type event_type_name 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced event_type_name 8. model.amplitude_source.stg_amplitude__event_type:f0->2. model.amplitude.amplitude__event_enhanced:f0 5. model.amplitude.int_amplitude__date_spine 5. model.amplitude.int_amplitude__date_spine event_type 2. model.amplitude.amplitude__event_enhanced:f0->5. model.amplitude.int_amplitude__date_spine:f0 1. model.amplitude.amplitude__daily_performance 1. model.amplitude.amplitude__daily_performance event_type 2. model.amplitude.amplitude__event_enhanced:f0->1. model.amplitude.amplitude__daily_performance:f0 5. model.amplitude.int_amplitude__date_spine:f0->1. model.amplitude.amplitude__daily_performance:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • event_type_name: Directly mapped to this output column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 8. model.amplitude_source.stg_amplitude__event_type[event_type_name]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with event_data
    • Output Columns:
      • event_type_name: Directly mapped
1. model.amplitude.amplitude__daily_performance
  • Input Column: 5. model.amplitude.int_amplitude__date_spine[event_type]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the agg_event_data CTE
    • Aggregation The column is grouped by in the agg_event_data CTE
    • Output Columns:
      • event_type: Directly mapped to the output column
5. model.amplitude.int_amplitude__date_spine
  • Input Column: 2. model.amplitude.amplitude__event_enhanced[event_type_name]
    • Integration Used to join with the spine table to create records for each event type
    • Output Columns:
      • event_type: Likely mapped directly to this output column
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp non_active 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type is_non_active 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[non_active]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as BOOLEAN type
    • Output Columns:
      • is_non_active: Directly mapped to this output column
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp timeline_hidden 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type is_timeline_hidden 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[timeline_hidden]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as BOOLEAN type
    • Output Columns:
      • is_timeline_hidden: Directly mapped to this output column
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp totals 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type totals 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced totals 8. model.amplitude_source.stg_amplitude__event_type:f0->2. model.amplitude.amplitude__event_enhanced:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[totals]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • totals: Directly mapped to this output column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 8. model.amplitude_source.stg_amplitude__event_type[totals]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • totals: Directly mapped
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp totals_delta 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type totals_delta 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[totals_delta]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • totals_delta: Directly mapped to this output column
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp value 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type value 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0 2. model.amplitude.amplitude__event_enhanced 2. model.amplitude.amplitude__event_enhanced value 8. model.amplitude_source.stg_amplitude__event_type:f0->2. model.amplitude.amplitude__event_enhanced:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[value]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • value: Directly mapped to this output column
2. model.amplitude.amplitude__event_enhanced
  • Input Column: 8. model.amplitude_source.stg_amplitude__event_type[value]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • value: Directly mapped
Column Lineage
%3 9. model.amplitude_source.stg_amplitude__event_type_tmp 9. model.amplitude_source.stg_amplitude__event_type_tmp waitroom_approved 8. model.amplitude_source.stg_amplitude__event_type 8. model.amplitude_source.stg_amplitude__event_type is_waitroom_approved 9. model.amplitude_source.stg_amplitude__event_type_tmp:f0->8. model.amplitude_source.stg_amplitude__event_type:f0
8. model.amplitude_source.stg_amplitude__event_type
  • Input Column: 9. model.amplitude_source.stg_amplitude__event_type_tmp[waitroom_approved]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • is_waitroom_approved: Directly mapped to this output column
10. source.amplitude_source.amplitude.event
The model details are not provided
11. source.amplitude_source.amplitude.event_type
The model details are not provided