Creating a Lookup Table

Lookup tables are a key-value store for faster lookups by key, for example, to get all users who clicked on a specific ad in a specific timeframe.

Lookup tables are useful for:

Real-time aggregations: An Upsolver lookup table replaces ETL code and a serving DB like Redis or Cassandra. When a lookup table is defined as real time, instead of waiting until the data is written to S3 and to the disk, the event’s details (the delta) are updated directly in-memory and only then stored in S3.
Join between streams: By querying a lookup table, it is possible to enrich one stream with data from another stream.

You can easily create a lookup table based on any of your existing data sources.

A lookup table is based on one or more keys, and one or more aggregations. Aggregations are functions that group multiple events together to form a more significant result. An aggregation function can return a single value or a hash table. For example, MAX stores the maximum value for the selected stream data for each key value for the selected window period.

Unlike databases, Upsolver runs continuous queries and not ad-hoc queries. Therefore, aggregation results are incrementally updated with every incoming event.

You can also:

Apply filters to your lookup table. These are equivalent to SQL WHERE statements.
Enrich your lookup table using calculated fields. This enables you to transform your data using a variety of built-in formulas such as: running a regular expression, performing a mathematical operation, extracting structured information from your raw User-Agent data and much more.
Add lookups to further enrich your lookup table.

To create a lookup table:

1. Click OUTPUTS.
3. Click NEW.
4. Complete the fields:
NAME: The new lookup table name.
DATA SOURCES: The data source to base your lookup table on.
5. Click CREATE.
6. In the fields tree, to view information about a field, click to see the following:
DENSITY IN EVENTS: How many of the events in this data source include this field, expressed as a percentage, for example, 20.81%.
DENSITY IN …: The density in the hierarchy, that is, how many of the events in this branch of the data hierarchy include this field, expressed a percentage.
DISTINCT VALUES: How many unique values appear in this field.
TOTAL VALUES: The total number of values ingested for this field.
FIRST SEEN: The first time this field included a value, for example, A YEAR AGO.
LAST SEEN: The last time this field included a value, for example,2 MINUTES AGO.
VALUE DISTRIBUTION: The percentage distribution of the field values. These distribution values can be exported by clicking EXPORT.
FIELD CONTENT SAMPLES OVER TIME: A time-series graph of the total number of events that include the selected field.
SELECTED: The most recent data values for the selected field and columns. You can change the columns that appear by clicking CHOOSE COLUMNS.

If a hierarchy element is selected, the following metrics appear:

# OF FIELDS: The number of fields in the selected hierarchy.
# OF KEYS: The number of keys in the selected hierarchy.
# OF ARRAYS: The number of arrays in the selected hierarchy.
FIELDS BREAKDOWN:A stacked bar chart (by data type) of the number of fields versus the density/distinct values or a stacked bar chart of the number of fields by data type.
FIELDS STATISTICS: A list of the fields in the hierarchy element, including Type, Density, Top Values, Key, Distinct Values, Array, First Seen, and Last Seen.
7. Add fields to your lookup table. In the fields tree, click to add a field from the data source to your lookup table. The Data Source Field is added to the Schema tab.
8. Add any required calculated fields. See:
Adding Calculated Fields
9. Add any required lookups. See:
Adding Lookups from Data Sources
Adding Lookups from Lookup Tables
Adding Lookups from Reference Data
10. To add a data source filter like WHERE in SQL, in the FILTERS tab, add a filter. See:
Adding Filters
11. To turn the lookup table into an aggregation, click ADD AGGREGATION. The aggregation field is added to the Schema tab. See:
Aggregation Functions
12. Finally, to run the lookup table, see:
Running an Output.

Note: You can edit the contents of a new lookup table only if it has not yet run. Once a lookup table has run, it cannot be edited. Instead duplicate the lookup table and edit the copy. See Duplicating an Output.