Alooma automatically creates one or more event types for each integration/input, depending on the type of input, and automatically adds a field under the
_metadata dictionary called
event_type to each event type data structure:
If the input is a structured data source, such as Salesforce or MySQL, then the event types are automatically created based on the object or table name, respectively. Otherwise, the input label is used, which is the name you gave the input at the time of creation.
Create a New Event Type
Why create a new event type?
You can create multiple event types for the same input when you want to split up and replicate data from that input into more than one table in the target data warehouse.
You can also create a new event type when you want to map two different inputs into the same table in your target data warehouse. In this case, you might use the target table name as the event type name and use the Code Engine to merge the fields from both sources.
You can leverage the value of the event type field in the Code Engine to create additional event types.
As an example, the following describes how to create an event type for each value of a field named Type. The values of the Type field (such as Type A, Type B, Type C and so on) will then appear in the Mapper screen’s event type list.
In the transform function, add a Python command that changes the value of the
event_typefield of the
For example, the following shows how to change
event['_metadata']['event_type']to the value of the
typefield of the event. Alooma then creates multiple new event types (one for each value of the type field). You can then map each event type to the table of your choice in the target data warehouse.
event['_metadata']['event_type'] = event['type']
Select a sample event from the Sample area of the Code Engine, then click Run Test to display the results of this change on the displayed sample event.
Click Deploy to publish these changes. All subsequent events will be transformed by the Code Engine using this code. Note that the Code Engine only runs on newly arriving events, and does not affect data already replicated into your target data warehouse.