com.snowplowanalytics.snowplow.enrich.common.enrichments
Turns an event code into a valid event type, e.g.
Turns an event code into a valid event type, e.g. "pv" -> "page_view". See the Tracker Protocol for details:
https://github.com/snowplow/snowplow/wiki/snowplow-tracker-protocol#wiki-event2
the event type, or an error message if not recognised, boxed in a Scalaz Validation
Extracts the timestamp from the format as laid out in the Tracker Protocol:
Extracts the timestamp from the format as laid out in the Tracker Protocol:
https://github.com/snowplow/snowplow/wiki/snowplow-tracker-protocol#wiki-common-params
a Tuple of two Strings (date and time), or an error message if the format was invalid
Make a collector_tstamp Redshift-compatible
Make a collector_tstamp Redshift-compatible
Validation boxing the result of making the timestamp Redshift-compatible
Converts a Redshift-compatible timestamp String back into a Joda DateTime.
Converts a Redshift-compatible timestamp String back into a Joda DateTime.
The timestamp String to convert
the Joda DateTime
Returns a unique event ID.
Returns a unique event ID. The event ID is generated as a type 4 UUID, then converted to a String.
() on the function signature because it's not pure
the unique event ID
Calculate the derived timestamp
Calculate the derived timestamp
If dvce_sent_tstamp and dvce_created_tstamp are not null and the former is after the latter, add the difference between the two to the collector_tstamp. Otherwise just return the collector_tstamp.
TODO: given missing collectorTstamp is invalid, consider updating this signature to
..., collectorTstamp: String): Validation[String, String]
and making the call to this
function in the EnrichmentManager dependent on a Success(collectorTstamp).
derived timestamp
Converts a Joda DateTime into a Redshift-compatible timestamp String.
Converts a Joda DateTime into a Redshift-compatible timestamp String.
The Joda DateTime to convert to a timestamp String
the timestamp String
Holds the enrichments related to events.