Hi there, I noticed that when we use snowflake as ...
# support
w
Hi there, I noticed that when we use snowflake as destination, a property named
channel
gets overwritten by an internal field also named
channel
(i.e., our
channel
field never gets to snowflake). Would it be possible to avoid this? Thanks,
m
Hey There! 👋 Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but 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.
h
You could use a transform to overwrite their channel
w
thx @hundreds-lifeguard-65770!
m
Thanks @hundreds-lifeguard-65770
w
@shy-kite-21035, the solution above is a good workaround, but I feel like rudderstack snowflake destination/ integration should treat such internal fields slightly different, so that no fields would get overwritten. While overwriting it I have questions like "ok, what are the side-effect of overwriting an internal field that's actually hard coded by rudderstack nodejs lib?" or "why do internal fields and users properties get flatten when exported to snowflake, prioritizing one over the other? shouldn't properties and internal fields be treated different while exporting?", or even "how would I know I could not use
channel
as a property? this is not intuitive". Thx a lot for your support! I hope such feedback can also be useful for the team.
m
Hi Igor did this even work. I was checking on it and I feel that RudderStack will overwrite this field even if you use a user-transformation
h
Yeah the docs mention "RudderStack reserves the above-mentioned standard properties. In case of any conflict, RudderStack automatically discards the properties set by the user." - but channel is not in the list
probably should prefix them rather than discard
m
Igor can you share the source and destination Payloads
Yes maybe prefix rather than discard may work better.
👍 1
w
@shy-kite-21035, sure! I tried using the UI transformation tool to test it. There it replaced
channel
with the correct value when I used the payload bellow. I have not actually implemented it and checked on snowflake, tho.
Copy code
{
  "_metadata": {
    "nodeVersion": "16.20.2"
  },
  "anonymousId": "REDACTED",
  "channel": "server",
  "context": {
    "library": {
      "name": "analytics-node",
      "version": "2.0.4"
    },
    "traits": {
      "buyerEmail": "REDACTED",
      "referenceId": "REDACTED"
    }
  },
  "event": "Order Placed",
  "messageId": "REDACTED",
  "originalTimestamp": "2023-11-10T11:21:05.965Z",
  "properties": {
    "amount": 9.2,
    "channel": "ONLINE",
    "checkedOutAt": "2023-11-10T11:21:05.961Z",
    "createdAt": "2023-11-10T11:19:12.131Z",
    "currency": "REDACTED",
    "fulfilmentMethodId": "REDACTED",
    "orderId": "REDACTED",
    "paymentMethod": "REDACTED",
    "shopId": "REDACTED"
  },
  "rudderId": "REDACTED",
  "sentAt": "2023-11-10T11:21:15.969Z",
  "type": "track"
}
@hundreds-lifeguard-65770, I could not find
channel
as part of "RudderStack reserves the above-mentioned standard properties". Sorry if I missed it, but if it's not in there, should it maybe be added?
h
The transform should work - the user transform should be the last thing it does post any rudder processing - otherwise bad things would happen!
@wonderful-lifeguard-46250 yes it is not there - it should be added
m
Hi Redsquare the destination transformation occurs after the user-transformation (as it should)
Give me some time to test this and get back to you.
🙌 1
w
Thx @shy-kite-21035!!
h
So it can overwrite props I set in the transform!
m
Ideally it should not over-write but I think in this case it will.
h
the live events needs three columns then:)
m
But instead of that we have source live events, destination live events and transformation live events. Actually I did suggest that we could have multiple columns to show how the event changes across different stages but it was not taken up.
h
it would be much easier to visualise input->output
m
Hi so I checked this out as a Redsquare pointed out using a user transformation will actually work in this case. The key word "channel" is being used by RudderStack to send the info if the source is a web/mobile/server source. So when you send the same key in the event properties the former is being read instead of the latter when the event is sent to the destination. Ideally you would want both the fields (web/mobile/server and online/offline/other etc) in your destination, so one way would be to rename one of the columns. I will ask the team if there is a cleaner way to go about this such as using a prefix as suggested by Redsquare. If you prioritize the channel to be offline/online/other than a user transformation is the way to go about it and this is not a workaround as the main purpose of the transformation is to give you such flexibility.
w
gotcha. Thx @shy-kite-21035!