Hi there! Earlier today we created our first Trans...
# support
a
Hi there! Earlier today we created our first Transformation and mapped it to our Snowflake destination, but it doesn’t appear to actually be being used. The Transformation shows no events, and it’s clearly not being applied to the events coming through. No errors either. Would love a little guidance on getting this first simple Transformation up and running
m
Hey There! 👋 Your message has been received by the RudderStack team. We will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
a
Oh I think it must be because we’re on control plane lite
t
Hi Erik! User transformations are available in our Free Tier hosted Control Plane. Is that what you are using? You mentioned that you are on the control plane lite? Were you able to set up a user transformation through the control plane lite. Looking at my instance, that seems to not be possible. Let me know so we can help you get set up with our transformations feature!
a
Hi David! Yeah in my control plane, I’m able to set up Transformations and even attach them to Destinations, they just don’t take effect (which makes sense since we’re using the Control Plane Lite utility) https://www.rudderstack.com/docs/get-started/cloud-vs-open-source/
t
Do you have a screenshot of what that looks like on your side. We can also chat live if that helps as well
a
Sure! Here’s the connection page for the transformation I set up:
Happy to share whatever else or chat if helpful. I thought it wasn’t an option for us to use Transformations after finding that in the docs (about the control plane lite utility), but I would if it was available
t
Ah okay, so it looks like you are using our open source product, but you are using our hosted control plane which does have the ability to use user transformations. Our Control Plane Lite product is a different way to set up a connection
But you are right, since you are running in open source, you will not be able to see any metrics for this user transformations (in the events tab) however, it should still be taking affect
a
Oh interesting! I didn’t set it up but I should know more about it, thank you for clarifying that. Ok, so it doesn’t appear to be taking affect either - any info I can provide that might help us know why that is? All it’s supposed to do is add a column to the event with the current timestamp, but no dice
t
The reason you are not seeing this field in your warehouse is because you should be putting it in the
event.context
object. Since
load_ts
is being set as a top-level field it doesnt get brought into our warehouse schema. Here are some docs on our schema https://www.rudderstack.com/docs/destinations/warehouse-destinations/warehouse-schema/
a
Ohhh that makes perfect sense - amazing, thanks very much David! I’ll study up here and try to get it working. I’ll send an update here in case it’s helpful to you or any other community members!
Appears to be working now! Here’s the basic transformation. One thing I noticed is that only some of the events that came through in the last sync had this new field populated. Any thoughts on why that might be?
(For example, of 124 Tracks merged in in the last sync, only 36 had this field populated)
t
User transformations happen when the event is being processed through RudderStack. After it is processed and before it is sent to you warehouse, it will be staged and it will wait until the next warehouse sync time. It appears that your warehouse is set to sync every 1 hour so it is likely that only a portion of the events in that 1 hour worth of events was actually transformed.
for those 124 track events, were the 36 events that did have the new field the more recent events
a
Oh I see, that makes sense. Thanks very much, I’m learning a ton here. Hm I’m not sure if they were the more recent or not, what’s a good way to tell? No worries if there’s not a convenient way. My goal is to have this field populate for every event, so it can be used as an incrementality key. If you think it will be populated for all events going forward, and it will not be possible to load an event with a timestamp less than the most recent, then I think I’m good (let me know if that incrementality bit makes sense, I don’t think I worded that well)
(basically simulating a reliable, ordered,
loaded_at
timestamp of sorts)
t
Does the received_at column work for you?
a
I actually tried that, and I believe that unfortunately, it doesn’t work for this purpose in our case. We regularly get new events with
received_at
older than the current most recent, so we can’t depend on it for this purpose
t
Okay I guess I am just confused on the "older than the current most recent" part event 1 is received at 1:52 event 2 is received at 1:53 then event 3 is received at 1:51 Is this what you are referring to?
a
Yeah exactly right. Event 3 might arrive in Snowflake after Events 1 & 2 despite having an earlier
received_at
So perhaps my Transformation won’t work either, since it may be subject to the same issue…
t
Interesting, are they from the same sources. I see your warehouse has a namespace inputted and 3 different sources connected. Therefore, events from one source may be loaded into snowflake at different times than other ones
We persist order on the source level
a
Ohh no we haven’t thought of that. That’s really good to know, that explains a lot for me I think. In that case, is there any way to properly handle order across the sources? E.g. maybe my transformation will actually make this work for us?
Or maybe not since it happens before it’s staged, and not on the way to the destination…
One idea we had was to add a timestamp column to the destination tables and have it default to current_timestamp, but would Rudderstack be ok with that if we added a column like that on the Snowflake side?
(Sorry this is getting a bit deep, something we’re super interested in though)
t
Yea this is more of a staging dynamic. I am curious how big of delays you are seeing between some events. You can kind of get a sense of what I am referring to by looking at your warehouse syncs page. You will see that your node source gets synced every hour at the top of every hour. Where as your JS sources get synced every hour at the half hour. That means that the following could occur • Node source syncs all events from 3:00 - 4:00 @ 4:00 • JS Source syncs all events from 3:30 - 4:30 @ 4:30 So therefore events from 3:45 from your node source will be loaded at 4:00 and events from 3:30 from JS source will be loaded at 4:30
a
Ah yeah, that makes total sense. Thank you, good example. What do you think of our Snowflake side workaround? Will Rudderstack handle a modified destination table schema ok?
t
Yes you should be able to do that, I don't think RudderStack cares about extra columns. As long as it doesn't conflict with a field that is trying to be written to the table. I am asking a warehouse engineer just to confirm
a
Nice, I think that could be the most elegant solution here if it works. Great, I’ll wait to hear back just in case!
t
So essentially what you are looking for is the time that a particular row was added to the warehouse? a
loaded_at
timestamp?
a
Yep exactly!
t
Okay, I will circulate this internally. I am curious to hear what the use case is, and why this timestamp would be more useful in a certain situation vs any of the other timestamps attached to the event itself.
a
Definitely, more than happy to share! The short version is that, for performance reasons, we’d like to know which events are new since the last time we “processed” events into other tables (like in dbt for example). We have a couple of downstream systems that could benefit from this, dbt included. It would help with efficient incremental udpates to downstream entities
✅ 1
t
Asking the engineering team, they mentioned that you could use the
UUID_TS
column as that should be similar to a loaded_at timestamp. I wonder if that would work for your usecase
a
Interesting, thanks for the update! We may try it, and can report back if it works (or doesn’t) 👍🏼
Thanks again for the suggestion @tall-lawyer-58398 -
uuid_ts
does appear to be working for this purpose so far! It seems that our Snowflake destination never receives a record with a
uuid_ts
older than the most recent it already has across all 3 of its sources, so it can be used as a sort of “loaded_at” timestamp. Hope this helps someone else at some point too!