streaming-profile-transformations
v1.0.0
Published
## Features
Downloads
10
Keywords
Readme
streaming-profile-transformations
Features
getMainID (ID string)
This function will return an object containing (MAIN_ID, TYPE, VALID_AT) as a promise. Here "TYPE" is the id_type of "ID", for example, user_ID.
Example:
const mainIdObj = await getMainID(userID)
getFeature (ID string, optional: isMainID = false)
This function will return an object as a promise, which contains all the features of a user present in the Feature table.
If "ID" is MAIN_ID then this function will skip calling the getMainID function and will directly return features corresponding to that MAIN_ID.
Example:
const featuresObj = await getFeature(mainID, true)
const featuresObj = await getFeature(userID)
Steps to use this package in transformer
1. Set up a Redis
- Login to Redis lab.
- Create a New Database.
2. Set up a reverse ETL connection
You can check this tutorial to setup a rETL connection Video
Login to RudderStack.
Add the Snowflake ID Graph table as a new Source and set up Connection Settings.
As the ID Graph table doesn't have any primary key we have to generate a dummy primary key
use this model to generate a dummy primary key
select distinct(concat(ID1, ID1_TYPE, VALID_AT)) as key, ID1, ID1_TYPE, MAIN_ID, VALID_AT from TABLE_NAME;
Add Redis as a new Destination, use the Redis Cluster address
(optional) Add this Transformation to Redis Destination
export function transformEvent(event, metadata) { event.traits = { "TYPE": event.traits.ID1_TYPE, "MAIN_ID": event.traits.MAIN_ID, "VALID_AT": event.traits.VALID_AT, } return event }
Create an rETL connection between the Snowflake ID Graph table and Redis.
Add the Snowflake Feature table as a new Source and use MAIN_ID as the primary key.
Create another rETL connection between the Snowflake Feature table and Redis.