-- RDS_PROFILE_FOLLOW table for storing profile follow relationships from RDS
-- This table is populated by the Glue job which dumps data from RDS to S3 
-- and then loads it into Snowflake
-- Clustered by partition date for optimal query performance
CREATE TRANSIENT TABLE IF NOT EXISTS {profile_follow_table_name} CLUSTER BY (p_date) (
    -- Primary identifier
    ID VARCHAR(255),                                    -- Unique profile follow identifier
    
    -- Follow relationship
    FOLLOWED_PROFILE_ID NUMBER(38,0),                   -- ID of the profile being followed
    FOLLOWING_PROFILE_ID NUMBER(38,0),                  -- ID of the profile doing the following
    
    -- Timestamps
    CREATED_AT TIMESTAMP_TZ(9),                         -- When the follow was created
    UPDATED_AT TIMESTAMP_TZ(9),                         -- Last update timestamp
    
    -- Partitioning column for optimization
    P_DATE DATE                                         -- Partition date based on created_at
);

