purchasesthat has the columns
user, item, stateand I would like to create CA specific features. I can create a materialized view for California purchases as follows:
nameis the name of the materialized stream and can used in the same way that a normal source stream can be used, except that you can not directly write to it.
querydefines the SQL transformation to apply on the
dependenciesthat are listed.
output_columnsallow columns to be renamed.
GROUP BYtransformation. In this situation, the
materialize_tablecall should be used since we're creating a table from the stream. This is a common way to prepare streaming data for use in model features.
GROUP BY's can be used to generate arrays of items using the
collectfunction. For example, if I was to create a model feature that is an array of all a user's purchases, I can do that as follows:
JOINbetween two tables or across a table and a stream are supported. This allows for streams to be enriched with immutable tables like CSV files. For example, we can enrich the stream with the price of the item as follows: