Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If the data is not aggregated at a daily level, an event could also be shared at a week, month, year level as well by just defining a startDate and endDate start_date and end_date. Not the startDate and endDate start_date and end_date should cleanly fall in a week, month, year, last 7 days, last 15 days or last 30 days.

Code Block
languagejson
{
    "startDatestart_date": "2019-01-01",
    "endDateend_date": "2019-02-01",
    "grade": 1,
    "school_id": 901,
    "count": 23
}

...

The following keywords in an event will be treated as special keywords and don’t need to be part of the schema - date, startDate, endDate start_date, end_date, week, month, year and are preferred in the same order. They cannot be mappings to a dimension or dataset.

...

Code Block
languagetypescript
const transformer = {
    name: "transformer_name", 
    eventGrammar: "es11", //EventGrammar on which the transformer can act.
    datasetGrammar: "ds23", //Dataset that this transformer which modify.
    config: {
        actor((callback, receivetransform, transformBulk) => {

            // manage side effects here 
            // Examples - logging, pushing to an externa event bus, etc.
            callback('SOME_EVENT');

            // receive from parent
            transform((event: Event) => {
              // transform event to dataset; Has access to event and dataset grammars for validation
            });
            
            // for speedups
            transformtransformBulk((event: Event[]) => {
              // transform events to dataset; Has access to event and dataset grammars for validation
            });

            // disposal
            return () => {
              /* do cleanup here */
              /* push this to dataset */
            };
        }),
    }
}

...